Skip to content

Commit

Permalink
Add option_dual_fund feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dunxen committed Jul 11, 2024
1 parent 86dde5d commit e8cabb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11268,6 +11268,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
}

Expand Down
10 changes: 8 additions & 2 deletions lightning/src/ln/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
//! (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/pull/851/files) for more information).
// TODO: update link
//! - `OnionMessages` - requires/supports forwarding onion messages
//! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
// TODO: update link
Expand Down Expand Up @@ -149,7 +152,7 @@ mod sealed {
// Byte 2
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
// Byte 3
RouteBlinding | ShutdownAnySegwit | Taproot,
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
// Byte 4
OnionMessages,
// Byte 5
Expand All @@ -167,7 +170,7 @@ mod sealed {
// Byte 2
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
// Byte 3
RouteBlinding | ShutdownAnySegwit | Taproot,
RouteBlinding | ShutdownAnySegwit | DualFund | Taproot,
// Byte 4
OnionMessages,
// Byte 5
Expand Down Expand Up @@ -409,6 +412,9 @@ mod sealed {
define_feature!(27, ShutdownAnySegwit, [InitContext, NodeContext],
"Feature flags for `opt_shutdown_anysegwit`.", set_shutdown_any_segwit_optional,
set_shutdown_any_segwit_required, 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, [InitContext, NodeContext, ChannelTypeContext],
"Feature flags for `option_taproot`.", set_taproot_optional,
set_taproot_required, supports_taproot, requires_taproot);
Expand Down
1 change: 1 addition & 0 deletions lightning/src/ln/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,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();
Expand Down

0 comments on commit e8cabb8

Please sign in to comment.