Skip to content

Commit b7873e3

Browse files
committed
f max -> min
1 parent 8a40db6 commit b7873e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,8 +2774,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
27742774

27752775
let on_holder_dust_htlc_exposure_msat = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat;
27762776
if on_holder_dust_htlc_exposure_msat as i64 + htlc_timeout_dust_limit as i64 * 1000 - 1 > self.get_max_dust_htlc_exposure_msat() as i64 {
2777-
remaining_msat_below_dust_exposure_limit = Some(cmp::max(
2778-
remaining_msat_below_dust_exposure_limit.unwrap_or(0),
2777+
remaining_msat_below_dust_exposure_limit = Some(cmp::min(
2778+
remaining_msat_below_dust_exposure_limit.unwrap_or(u64::max_value()),
27792779
self.get_max_dust_htlc_exposure_msat().saturating_sub(on_holder_dust_htlc_exposure_msat)));
27802780
dust_exposure_dust_limit_msat = cmp::max(dust_exposure_dust_limit_msat, htlc_timeout_dust_limit * 1000);
27812781
}

0 commit comments

Comments
 (0)