]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add `option_dual_fund` feature
authorDuncan Dean <git@dunxen.dev>
Wed, 13 Sep 2023 21:42:05 +0000 (23:42 +0200)
committerDuncan Dean <git@dunxen.dev>
Wed, 20 Nov 2024 12:01:42 +0000 (14:01 +0200)
lightning-types/src/features.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/peer_handler.rs

index 036ac4e84ba4b78c6f6ec5563ded093e30ae92c3..a1487721b24bcae17ba4a4c1f3a5f7cb8f64408f 100644 (file)
@@ -49,6 +49,8 @@
 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#route-blinding) for more information).
 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
+//! - `DualFund` - requires/supports V2 channel establishment
+//!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#channel-establishment-v2) for more information).
 //! - `OnionMessages` - requires/supports forwarding onion messages
 //!     (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
 //     TODO: update link
@@ -146,7 +148,7 @@ mod sealed {
                        // Byte 2
                        BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
                        // Byte 3
-                       RouteBlinding | ShutdownAnySegwit | Taproot,
+                       RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
                        // Byte 4
                        OnionMessages,
                        // Byte 5
@@ -167,7 +169,7 @@ mod sealed {
                        // Byte 2
                        BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
                        // Byte 3
-                       RouteBlinding | ShutdownAnySegwit | Taproot,
+                       RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
                        // Byte 4
                        OnionMessages,
                        // Byte 5
@@ -502,6 +504,16 @@ mod sealed {
                supports_shutdown_anysegwit,
                requires_shutdown_anysegwit
        );
+       define_feature!(
+               29,
+               DualFund,
+               [InitContext, NodeContext],
+               "Feature flags for `option_dual_fund`.",
+               set_dual_fund_optional,
+               set_dual_fund_required,
+               supports_dual_fund,
+               requires_dual_fund
+       );
        define_feature!(
                31,
                Taproot,
index 096996fe4d148fe4013bfdef96a1ad1b84c877e4..9ef6ca7ffaeba98ac7b8bb33a56691195ed529d6 100644 (file)
@@ -12297,6 +12297,7 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
        if config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx {
                features.set_anchors_zero_fee_htlc_tx_optional();
        }
+       features.set_dual_fund_optional();
        features
 }
 
index 96a5df3b46437fc3385794ea3a570b351ece46c9..3bed6a0894ae8a7a4db7b2c3e8e4094aa7de025c 100644 (file)
@@ -340,6 +340,7 @@ impl ChannelMessageHandler for ErroringMessageHandler {
                features.set_basic_mpp_optional();
                features.set_wumbo_optional();
                features.set_shutdown_any_segwit_optional();
+               features.set_dual_fund_optional();
                features.set_channel_type_optional();
                features.set_scid_privacy_optional();
                features.set_zero_conf_optional();