File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5847,7 +5847,7 @@ impl<SP: SignerProvider> ChannelContext<SP> {
58475847 1
58485848 };
58495849 // Note that the feerate is 0 in zero-fee commitment channels, so this statement is a noop
5850- let spiked_feerate = feerate * fee_spike_multiple;
5850+ let spiked_feerate = feerate.saturating_mul( fee_spike_multiple) ;
58515851 let (remote_stats, _remote_htlcs) = self
58525852 .get_next_remote_commitment_stats(
58535853 funding,
@@ -13333,7 +13333,8 @@ where
1333313333 let feerate_per_kw = if !funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
1333413334 // Similar to HTLC additions, require the funder to have enough funds reserved for
1333513335 // fees such that the feerate can jump without rendering the channel useless.
13336- self.context.feerate_per_kw * FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32
13336+ let spike_mul = FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32;
13337+ self.context.feerate_per_kw.saturating_mul(spike_mul)
1333713338 } else {
1333813339 self.context.feerate_per_kw
1333913340 };
Original file line number Diff line number Diff line change @@ -336,12 +336,13 @@ fn get_available_balances(
336336 if channel_type. supports_anchor_zero_fee_commitments ( ) { 0 } else { 1 } ;
337337
338338 // Note that the feerate is 0 in zero-fee commitment channels, so this statement is a noop
339- let spiked_feerate = feerate_per_kw
340- * if is_outbound_from_holder && !channel_type. supports_anchors_zero_fee_htlc_tx ( ) {
339+ let spiked_feerate = feerate_per_kw. saturating_mul (
340+ if is_outbound_from_holder && !channel_type. supports_anchors_zero_fee_htlc_tx ( ) {
341341 crate :: ln:: channel:: FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32
342342 } else {
343343 1
344- } ;
344+ } ,
345+ ) ;
345346
346347 let local_nondust_htlc_count = pending_htlcs
347348 . iter ( )
You can’t perform that action at this time.
0 commit comments