From 06a720fa7fbd8566606246b977f2052138eb150c Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Mon, 19 Jun 2023 10:28:36 -0700 Subject: [PATCH] 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. --- lightning/src/ln/features.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- 2.39.5