Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5847,7 +5847,7 @@ impl<SP: SignerProvider> ChannelContext<SP> {
1
};
// Note that the feerate is 0 in zero-fee commitment channels, so this statement is a noop
let spiked_feerate = feerate * fee_spike_multiple;
let spiked_feerate = feerate.saturating_mul(fee_spike_multiple);
let (remote_stats, _remote_htlcs) = self
.get_next_remote_commitment_stats(
funding,
Expand Down Expand Up @@ -13333,7 +13333,8 @@ where
let feerate_per_kw = if !funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
// Similar to HTLC additions, require the funder to have enough funds reserved for
// fees such that the feerate can jump without rendering the channel useless.
self.context.feerate_per_kw * FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32
let spike_mul = FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32;
self.context.feerate_per_kw.saturating_mul(spike_mul)
} else {
self.context.feerate_per_kw
};
Expand Down
7 changes: 4 additions & 3 deletions lightning/src/sign/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,13 @@ fn get_available_balances(
if channel_type.supports_anchor_zero_fee_commitments() { 0 } else { 1 };

// Note that the feerate is 0 in zero-fee commitment channels, so this statement is a noop
let spiked_feerate = feerate_per_kw
* if is_outbound_from_holder && !channel_type.supports_anchors_zero_fee_htlc_tx() {
let spiked_feerate = feerate_per_kw.saturating_mul(
if is_outbound_from_holder && !channel_type.supports_anchors_zero_fee_htlc_tx() {
crate::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32
} else {
1
};
},
);

let local_nondust_htlc_count = pending_htlcs
.iter()
Expand Down
Loading