Skip to content

Commit 4ffb677

Browse files
committed
Define ChannelTypeFeatures methods for anchors logic.
Specifically, introduce a new constructor for an anchors- supporting feature set, as well as methods that will maintain forwards-compatible deserialization in older versions.
1 parent 8403627 commit 4ffb677

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lightning/src/ln/features.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,15 @@ impl ChannelTypeFeatures {
581581
<sealed::ChannelTypeContext as sealed::StaticRemoteKey>::set_required_bit(&mut ret.flags);
582582
ret
583583
}
584+
585+
#[cfg(any(anchors, test))]
586+
/// Constructs a ChannelTypeFeatures with anchors support
587+
pub(crate) fn anchors_zero_htlc_fee_and_dependencies() -> Self {
588+
let mut ret = Self::empty();
589+
<sealed::ChannelTypeContext as sealed::StaticRemoteKey>::set_required_bit(&mut ret.flags);
590+
<sealed::ChannelTypeContext as sealed::AnchorsZeroFeeHtlcTx>::set_required_bit(&mut ret.flags);
591+
ret
592+
}
584593
}
585594

586595
impl ToBase32 for InvoiceFeatures {

0 commit comments

Comments
 (0)