File tree 1 file changed +1
-1
lines changed
1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -2957,7 +2957,7 @@ impl<Signer: Sign> Channel<Signer> {
2957
2957
let inbound_stats = self . get_inbound_pending_htlc_stats ( Some ( feerate_per_kw) ) ;
2958
2958
let outbound_stats = self . get_outbound_pending_htlc_stats ( Some ( feerate_per_kw) ) ;
2959
2959
let total_fee = feerate_per_kw as u64 * ( COMMITMENT_TX_BASE_WEIGHT + ( inbound_stats. pending_htlcs as u64 + outbound_stats. pending_htlcs as u64 ) * COMMITMENT_TX_WEIGHT_PER_HTLC ) / 1000 ;
2960
- if self . value_to_self_msat / 1000 - total_fee < self . counterparty_selected_channel_reserve_satoshis . unwrap ( ) {
2960
+ if self . value_to_self_msat / 1000 - total_fee - outbound_stats . pending_htlcs_value_msat < self . counterparty_selected_channel_reserve_satoshis . unwrap ( ) {
2961
2961
log_debug ! ( logger, "Cannot afford to send new feerate at {}" , feerate_per_kw) ;
2962
2962
return None ;
2963
2963
}
You can’t perform that action at this time.
0 commit comments