Skip to content

Commit 23db9e9

Browse files
committed
Add option_dual_fund feature
1 parent 1f22b15 commit 23db9e9

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
@@ -147,7 +149,7 @@ mod sealed {
147149
// Byte 2
148150
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
149151
// Byte 3
150-
RouteBlinding | ShutdownAnySegwit | Taproot,
152+
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
151153
// Byte 4
152154
OnionMessages,
153155
// Byte 5
@@ -168,7 +170,7 @@ mod sealed {
168170
// Byte 2
169171
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
170172
// Byte 3
171-
RouteBlinding | ShutdownAnySegwit | Taproot,
173+
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
172174
// Byte 4
173175
OnionMessages,
174176
// Byte 5
@@ -499,6 +501,16 @@ mod sealed {
499501
supports_shutdown_anysegwit,
500502
requires_shutdown_anysegwit
501503
);
504+
define_feature!(
505+
29,
506+
DualFund,
507+
[InitContext, NodeContext],
508+
"Feature flags for `option_dual_fund`.",
509+
set_dual_fund_optional,
510+
set_dual_fund_required,
511+
supports_dual_fund,
512+
requires_dual_fund
513+
);
502514
define_feature!(
503515
31,
504516
Taproot,

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11724,6 +11724,7 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
1172411724
if config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx {
1172511725
features.set_anchors_zero_fee_htlc_tx_optional();
1172611726
}
11727+
features.set_dual_fund_optional();
1172711728
features
1172811729
}
1172911730

lightning/src/ln/peer_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ impl ChannelMessageHandler for ErroringMessageHandler {
331331
features.set_basic_mpp_optional();
332332
features.set_wumbo_optional();
333333
features.set_shutdown_any_segwit_optional();
334+
features.set_dual_fund_optional();
334335
features.set_channel_type_optional();
335336
features.set_scid_privacy_optional();
336337
features.set_zero_conf_optional();

0 commit comments

Comments
 (0)