@@ -67,6 +67,26 @@ pub struct ChannelHandshakeConfig {
67
67
///
68
68
/// [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
69
69
pub forwarding_fee_base_msat : u32 ,
70
+ /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
71
+ /// the channel this config applies to.
72
+ ///
73
+ /// This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
74
+ /// HTLC balance when a channel appears on-chain whereas
75
+ /// [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
76
+ /// (non-HTLC-encumbered) balance.
77
+ ///
78
+ /// Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
79
+ /// we (or one of our watchtowers) MUST be online to check for broadcast of the current
80
+ /// commitment transaction at least once per this many blocks (minus some margin to allow us
81
+ /// enough time to broadcast and confirm a transaction, possibly with time in between to RBF
82
+ /// the spending transaction).
83
+ ///
84
+ /// Default value: 72 (12 hours at an average of 6 blocks/hour).
85
+ /// Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
86
+ /// [`MIN_CLTV_EXPIRY_DELTA`] instead.
87
+ ///
88
+ /// [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
89
+ pub cltv_expiry_delta : u16 ,
70
90
}
71
91
72
92
impl Default for ChannelHandshakeConfig {
@@ -77,6 +97,7 @@ impl Default for ChannelHandshakeConfig {
77
97
our_htlc_minimum_msat : 1 ,
78
98
forwarding_fee_base_msat : 1000 ,
79
99
forwarding_fee_proportional_millionths : 0 ,
100
+ cltv_expiry_delta : 6 * 12 , // 6 blocks/hour * 12 hours
80
101
}
81
102
}
82
103
}
@@ -165,26 +186,6 @@ impl Default for ChannelHandshakeLimits {
165
186
/// with our counterparty.
166
187
#[ derive( Copy , Clone , Debug ) ]
167
188
pub struct ChannelConfig {
168
- /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
169
- /// the channel this config applies to.
170
- ///
171
- /// This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
172
- /// HTLC balance when a channel appears on-chain whereas
173
- /// [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
174
- /// (non-HTLC-encumbered) balance.
175
- ///
176
- /// Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
177
- /// we (or one of our watchtowers) MUST be online to check for broadcast of the current
178
- /// commitment transaction at least once per this many blocks (minus some margin to allow us
179
- /// enough time to broadcast and confirm a transaction, possibly with time in between to RBF
180
- /// the spending transaction).
181
- ///
182
- /// Default value: 72 (12 hours at an average of 6 blocks/hour).
183
- /// Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
184
- /// [`MIN_CLTV_EXPIRY_DELTA`] instead.
185
- ///
186
- /// [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
187
- pub cltv_expiry_delta : u16 ,
188
189
/// Set to announce the channel publicly and notify all nodes that they can route via this
189
190
/// channel.
190
191
///
@@ -254,7 +255,6 @@ impl Default for ChannelConfig {
254
255
/// Provides sane defaults for most configurations (but with zero relay fees!).
255
256
fn default ( ) -> Self {
256
257
ChannelConfig {
257
- cltv_expiry_delta : 6 * 12 , // 6 blocks/hour * 12 hours
258
258
announced_channel : false ,
259
259
commit_upfront_shutdown_pubkey : true ,
260
260
max_dust_htlc_exposure_msat : 5_000_000 ,
@@ -265,7 +265,6 @@ impl Default for ChannelConfig {
265
265
266
266
impl_writeable_tlv_based ! ( ChannelConfig , {
267
267
( 1 , max_dust_htlc_exposure_msat, ( default_value, 5_000_000 ) ) ,
268
- ( 2 , cltv_expiry_delta, required) ,
269
268
( 3 , force_close_avoidance_max_fee_satoshis, ( default_value, 1000 ) ) ,
270
269
( 4 , announced_channel, required) ,
271
270
( 6 , commit_upfront_shutdown_pubkey, required) ,
0 commit comments