Skip to content

Commit f981446

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 675fa79 commit f981446

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
@@ -588,6 +588,15 @@ impl ChannelTypeFeatures {
588588
<sealed::ChannelTypeContext as sealed::StaticRemoteKey>::set_required_bit(&mut ret.flags);
589589
ret
590590
}
591+
592+
#[cfg(any(anchors, test))]
593+
/// Constructs a ChannelTypeFeatures with anchors support
594+
pub(crate) fn anchors_zero_htlc_fee_and_dependencies() -> Self {
595+
let mut ret = Self::empty();
596+
<sealed::ChannelTypeContext as sealed::StaticRemoteKey>::set_required_bit(&mut ret.flags);
597+
<sealed::ChannelTypeContext as sealed::AnchorsZeroFeeHtlcTx>::set_required_bit(&mut ret.flags);
598+
ret
599+
}
591600
}
592601

593602
impl ToBase32 for InvoiceFeatures {

0 commit comments

Comments
 (0)