Skip to content

Commit fe35561

Browse files
author
Antoine Riard
committed
-f subtract outbound value from holder balance
1 parent bd710b4 commit fe35561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2957,7 +2957,7 @@ impl<Signer: Sign> Channel<Signer> {
29572957
let inbound_stats = self.get_inbound_pending_htlc_stats(Some(feerate_per_kw));
29582958
let outbound_stats = self.get_outbound_pending_htlc_stats(Some(feerate_per_kw));
29592959
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() {
29612961
log_debug!(logger, "Cannot afford to send new feerate at {}", feerate_per_kw);
29622962
return None;
29632963
}

0 commit comments

Comments
 (0)