@@ -246,10 +246,13 @@ pub struct ChannelConfig {
246
246
/// [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
247
247
/// [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
248
248
pub force_close_avoidance_max_fee_satoshis : u64 ,
249
- /// If this is set to false, we do not auto-close channel with pending time-sensitive outputs,
250
- /// of which the feerate has been detected as stalling.
251
- /// Default value: true.
252
- pub should_autoclose : bool ,
249
+ /// Maximum feerate variation for a given `cltv_expiry_delta` period. Increasing the variation
250
+ /// rate, make the auto-close mechanism react faster to more sensitive fee spikes.
251
+ ///
252
+ /// Setting the value to 0 disable auto-close.
253
+ ///
254
+ /// Default value: 1300 (30%)
255
+ pub autoclose_variation_rate : u32 ,
253
256
}
254
257
255
258
impl Default for ChannelConfig {
@@ -263,7 +266,7 @@ impl Default for ChannelConfig {
263
266
commit_upfront_shutdown_pubkey : true ,
264
267
max_dust_htlc_exposure_msat : 5_000_000 ,
265
268
force_close_avoidance_max_fee_satoshis : 1000 ,
266
- should_autoclose : true ,
269
+ autoclose_variation_rate : 1300 ,
267
270
}
268
271
}
269
272
}
@@ -276,7 +279,7 @@ impl_writeable_tlv_based!(ChannelConfig, {
276
279
( 4 , announced_channel, required) ,
277
280
( 6 , commit_upfront_shutdown_pubkey, required) ,
278
281
( 8 , forwarding_fee_base_msat, required) ,
279
- ( 10 , should_autoclose , ( default_value, true ) ) ,
282
+ ( 10 , autoclose_variation_rate , ( default_value, 1300 ) ) ,
280
283
} ) ;
281
284
282
285
/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
0 commit comments