File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -3170,7 +3170,10 @@ impl<Signer: Sign> Channel<Signer> {
3170
3170
let buffer_fee_msat = Channel :: < Signer > :: commit_tx_fee_sat ( feerate_per_kw, commitment_stats. num_nondust_htlcs + outbound_stats. on_holder_tx_holding_cell_htlcs_count as usize + CONCURRENT_INBOUND_HTLC_FEE_BUFFER as usize ) * 1000 ;
3171
3171
let holder_balance_msat = commitment_stats. local_balance_msat - outbound_stats. holding_cell_msat ;
3172
3172
if holder_balance_msat < buffer_fee_msat + self . counterparty_selected_channel_reserve_satoshis . unwrap ( ) * 1000 {
3173
- //TODO: auto-close after a number of failures?
3173
+ // If we're failing affordance, start a autoclose timer as the situation is
3174
+ // likely unsafe due to a heavy-loaded channel, of which the feerate should
3175
+ // become less and less compelling.
3176
+ self . maybe_trigger_autoclose_timer ( self . get_feerate ( ) , feerate_per_kw) ;
3174
3177
log_debug ! ( logger, "Cannot afford to send new feerate at {}" , feerate_per_kw) ;
3175
3178
return None ;
3176
3179
}
You can’t perform that action at this time.
0 commit comments