Skip to content

Commit fd2a34d

Browse files
committed
f Split cltv_expiry_delta default and minimum and walk back 6*12 test change
1 parent 90de1c4 commit fd2a34d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,11 +2966,7 @@ fn test_htlc_on_chain_timeout() {
29662966

29672967
let chanmon_cfgs = create_chanmon_cfgs(3);
29682968
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
2969-
let mut cfg = UserConfig::default();
2970-
// This test was written when the CLTV_EXPIRY_DELTA was fixed at 12*6, and expects it.
2971-
cfg.channel_options.cltv_expiry_delta = 12*6;
2972-
cfg.channel_options.announced_channel = true;
2973-
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[Some(cfg.clone()), Some(cfg.clone()), Some(cfg.clone())]);
2969+
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[None, None, None]);
29742970
let nodes = create_network(3, &node_cfgs, &node_chanmgrs);
29752971

29762972
// Create some intial channels

lightning/src/util/config.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! Various user-configurable channel limits and settings which ChannelManager
1111
//! applies for you.
1212
13-
use ln::channelmanager::{BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, MAX_LOCAL_BREAKDOWN_TIMEOUT};
13+
use ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
1414

1515
/// Configuration we set when applicable.
1616
///
@@ -172,10 +172,14 @@ pub struct ChannelConfig {
172172
/// Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
173173
/// we (or one of our watchtowers) MUST be online to check for broadcast of the current
174174
/// commitment transaction at least once per this many blocks (plus some margin to allow us
175-
/// enough time to broadcast and confirm a transaction).
175+
/// enough time to broadcast and confirm a transaction, possibly with time in between to RBF
176+
/// the spending transaction).
176177
///
177-
/// Default value: [`MIN_CLTV_EXPIRY_DELTA`], which we enforce as a minimum so you can change
178-
/// the config to ask for more security, not less.
178+
/// Default value: 72 (12 hours at an average of 6 blocks/hour).
179+
/// Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
180+
/// [`MIN_CLTV_EXPIRY_DELTA`] instead.
181+
///
182+
/// [`MIN_CLTV_EXPIRY_DELTA`]: ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
179183
pub cltv_expiry_delta: u16,
180184
/// Set to announce the channel publicly and notify all nodes that they can route via this
181185
/// channel.
@@ -208,7 +212,7 @@ impl Default for ChannelConfig {
208212
fn default() -> Self {
209213
ChannelConfig {
210214
fee_proportional_millionths: 0,
211-
cltv_expiry_delta: MIN_CLTV_EXPIRY_DELTA,
215+
cltv_expiry_delta: 6 * 12, // 6 blocks/hour * 12 hours
212216
announced_channel: false,
213217
commit_upfront_shutdown_pubkey: true,
214218
}

0 commit comments

Comments
 (0)