Skip to content

Commit 0fe202d

Browse files
Conditionally advertise htlc_hold feature
Now that we support the feature of sending payments as an often-offline sender to an often-offline recipient, including the sender's LSP-side, we can start conditionally advertising the feature bit to other nodes on the network. Also remove an outdated comment, in a previous version of the code we had more logic to check if we're an always-online node before advertising the feature bit but it's since been removed.
1 parent 8a38c88 commit 0fe202d

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
10481048
// our network key
10491049
ext_from_hex("0100000000000000000000000000000000000000000000000000000000000000", &mut test);
10501050
// config
1051-
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff00010000000000", &mut test);
1051+
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff0001000000000000", &mut test);
10521052

10531053
// new outbound connection with id 0
10541054
ext_from_hex("00", &mut test);
@@ -1502,7 +1502,7 @@ fn gossip_exchange_seed() -> Vec<u8> {
15021502
// our network key
15031503
ext_from_hex("0100000000000000000000000000000000000000000000000000000000000000", &mut test);
15041504
// config
1505-
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff00010000000000", &mut test);
1505+
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff0001000000000000", &mut test);
15061506

15071507
// new outbound connection with id 0
15081508
ext_from_hex("00", &mut test);

lightning/src/ln/channelmanager.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15203,9 +15203,6 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
1520315203
features.set_anchor_zero_fee_commitments_optional();
1520415204
}
1520515205

15206-
// If we are configured to be an announced node, we are expected to be always-online and can
15207-
// advertise the htlc_hold feature.
15208-
#[cfg(test)]
1520915206
if config.enable_htlc_hold {
1521015207
features.set_htlc_hold_optional();
1521115208
}

lightning/src/util/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,6 @@ pub struct UserConfig {
941941
/// Setting this to `true` may break backwards compatibility with LDK versions < 0.2.
942942
///
943943
/// Default value: `false`
944-
#[cfg(test)]
945944
pub enable_htlc_hold: bool,
946945
/// If this is set to true, then if we as an often-offline payer receive a [`StaticInvoice`] to
947946
/// pay, we will attempt to hold the corresponding outbound HTLCs with our next-hop channel
@@ -971,7 +970,6 @@ impl Default for UserConfig {
971970
accept_intercept_htlcs: false,
972971
manually_handle_bolt12_invoices: false,
973972
enable_dual_funded_channels: false,
974-
#[cfg(test)]
975973
enable_htlc_hold: false,
976974
hold_outbound_htlcs_at_next_hop: false,
977975
}
@@ -995,6 +993,7 @@ impl Readable for UserConfig {
995993
manually_handle_bolt12_invoices: Readable::read(reader)?,
996994
enable_dual_funded_channels: Readable::read(reader)?,
997995
hold_outbound_htlcs_at_next_hop: Readable::read(reader)?,
996+
enable_htlc_hold: Readable::read(reader)?,
998997
})
999998
}
1000999
}

0 commit comments

Comments
 (0)