Skip to content

Commit ac8aa68

Browse files
committed
Move V2 channel opens behind a cfg flag again
While its somewhat sad to do, we didn't really make the progress we wanted on dual funded channels in 0.2, and thus aren't super confident in them. Further, because we still don't support actually contributing inputs to an inbound channel nor outbound v2 channel opens there's not really any reason to support them. Thus, we simply re-cfg-gate them here for 0.2.
1 parent 21e9a9c commit ac8aa68

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ check-cfg = [
6767
"cfg(require_route_graph_test)",
6868
"cfg(simple_close)",
6969
"cfg(peer_storage)",
70+
"cfg(dual_funding)",
7071
]

ci/ci-tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,5 @@ RUSTFLAGS="--cfg=simple_close" cargo test --verbose --color always -p lightning
163163
RUSTFLAGS="--cfg=lsps1_service" cargo test --verbose --color always -p lightning-liquidity
164164
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
165165
RUSTFLAGS="--cfg=peer_storage" cargo test --verbose --color always -p lightning
166+
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
167+
RUSTFLAGS="--cfg=dual_funding" cargo test --verbose --color always -p lightning

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15603,6 +15603,7 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
1560315603
if config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx {
1560415604
features.set_anchors_zero_fee_htlc_tx_optional();
1560515605
}
15606+
#[cfg(dual_funding)]
1560615607
if config.enable_dual_funded_channels {
1560715608
features.set_dual_fund_optional();
1560815609
}

lightning/src/util/config.rs

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ pub struct UserConfig {
927927
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
928928
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
929929
pub manually_handle_bolt12_invoices: bool,
930+
#[cfg(dual_funding)]
930931
/// If this is set to `true`, dual-funded channels will be enabled.
931932
///
932933
/// Default value: `false`
@@ -981,6 +982,7 @@ impl Default for UserConfig {
981982
manually_accept_inbound_channels: false,
982983
accept_intercept_htlcs: false,
983984
manually_handle_bolt12_invoices: false,
985+
#[cfg(dual_funding)]
984986
enable_dual_funded_channels: false,
985987
enable_htlc_hold: false,
986988
hold_outbound_htlcs_at_next_hop: false,
@@ -995,19 +997,32 @@ impl Default for UserConfig {
995997
#[cfg(fuzzing)]
996998
impl Readable for UserConfig {
997999
fn read<R: crate::io::Read>(reader: &mut R) -> Result<Self, crate::ln::msgs::DecodeError> {
1000+
let channel_handshake_config = Readable::read(reader)?;
1001+
let channel_handshake_limits = Readable::read(reader)?;
1002+
let channel_config = Readable::read(reader)?;
1003+
let accept_forwards_to_priv_channels = Readable::read(reader)?;
1004+
let accept_inbound_channels = Readable::read(reader)?;
1005+
let manually_accept_inbound_channels = Readable::read(reader)?;
1006+
let accept_intercept_htlcs = Readable::read(reader)?;
1007+
let manually_handle_bolt12_invoices = Readable::read(reader)?;
1008+
let _enable_dual_funded_channels: bool = Readable::read(reader)?;
1009+
let hold_outbound_htlcs_at_next_hop = Readable::read(reader)?;
1010+
let enable_htlc_hold = Readable::read(reader)?;
1011+
let reject_inbound_splices = Readable::read(reader)?;
9981012
Ok(Self {
999-
channel_handshake_config: Readable::read(reader)?,
1000-
channel_handshake_limits: Readable::read(reader)?,
1001-
channel_config: Readable::read(reader)?,
1002-
accept_forwards_to_priv_channels: Readable::read(reader)?,
1003-
accept_inbound_channels: Readable::read(reader)?,
1004-
manually_accept_inbound_channels: Readable::read(reader)?,
1005-
accept_intercept_htlcs: Readable::read(reader)?,
1006-
manually_handle_bolt12_invoices: Readable::read(reader)?,
1007-
enable_dual_funded_channels: Readable::read(reader)?,
1008-
hold_outbound_htlcs_at_next_hop: Readable::read(reader)?,
1009-
enable_htlc_hold: Readable::read(reader)?,
1010-
reject_inbound_splices: Readable::read(reader)?,
1013+
channel_handshake_config,
1014+
channel_handshake_limits,
1015+
channel_config,
1016+
accept_forwards_to_priv_channels,
1017+
accept_inbound_channels,
1018+
manually_accept_inbound_channels,
1019+
accept_intercept_htlcs,
1020+
manually_handle_bolt12_invoices,
1021+
#[cfg(dual_funding)]
1022+
enable_dual_funded_channels: _enable_dual_funded_channels,
1023+
hold_outbound_htlcs_at_next_hop,
1024+
enable_htlc_hold,
1025+
reject_inbound_splices,
10111026
})
10121027
}
10131028
}

0 commit comments

Comments
 (0)