Skip to content

Commit 85c0401

Browse files
committed
Add option_dual_fund feature
1 parent 3a72dc0 commit 85c0401

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

lightning-types/src/features.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
//! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#route-blinding) for more information).
5050
//! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
5151
//! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
52+
//! - `DualFund` - requires/supports V2 channel establishment
53+
//! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#channel-establishment-v2) for more information).
5254
//! - `OnionMessages` - requires/supports forwarding onion messages
5355
//! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
5456
// TODO: update link
@@ -146,7 +148,7 @@ mod sealed {
146148
// Byte 2
147149
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
148150
// Byte 3
149-
RouteBlinding | ShutdownAnySegwit | Taproot,
151+
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
150152
// Byte 4
151153
OnionMessages,
152154
// Byte 5
@@ -167,7 +169,7 @@ mod sealed {
167169
// Byte 2
168170
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
169171
// Byte 3
170-
RouteBlinding | ShutdownAnySegwit | Taproot,
172+
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
171173
// Byte 4
172174
OnionMessages,
173175
// Byte 5
@@ -502,6 +504,16 @@ mod sealed {
502504
supports_shutdown_anysegwit,
503505
requires_shutdown_anysegwit
504506
);
507+
define_feature!(
508+
29,
509+
DualFund,
510+
[InitContext, NodeContext],
511+
"Feature flags for `option_dual_fund`.",
512+
set_dual_fund_optional,
513+
set_dual_fund_required,
514+
supports_dual_fund,
515+
requires_dual_fund
516+
);
505517
define_feature!(
506518
31,
507519
Taproot,

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12323,6 +12323,7 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
1232312323
if config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx {
1232412324
features.set_anchors_zero_fee_htlc_tx_optional();
1232512325
}
12326+
features.set_dual_fund_optional();
1232612327
features
1232712328
}
1232812329

lightning/src/ln/peer_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ impl ChannelMessageHandler for ErroringMessageHandler {
340340
features.set_basic_mpp_optional();
341341
features.set_wumbo_optional();
342342
features.set_shutdown_any_segwit_optional();
343+
features.set_dual_fund_optional();
343344
features.set_channel_type_optional();
344345
features.set_scid_privacy_optional();
345346
features.set_zero_conf_optional();

0 commit comments

Comments
 (0)