From: Arik Sosman Date: Mon, 19 Jun 2023 17:28:36 +0000 (-0700) Subject: Define `ChannelTypeFeatures` methods for anchors logic. X-Git-Tag: v0.0.116-alpha1~4^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=06a720fa7fbd8566606246b977f2052138eb150c;p=rust-lightning 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. --- diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 3e3484e73..714bfaa55 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -594,6 +594,15 @@ impl ChannelTypeFeatures { ::set_required_bit(&mut ret.flags); ret } + + #[cfg(any(anchors, test))] + /// Constructs a ChannelTypeFeatures with anchors support + pub(crate) fn anchors_zero_htlc_fee_and_dependencies() -> Self { + let mut ret = Self::empty(); + ::set_required_bit(&mut ret.flags); + ::set_required_bit(&mut ret.flags); + ret + } } impl ToBase32 for InvoiceFeatures {