mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 23:08:36 +01:00
Use saturating_add
when adding inflight HTLCs values
Previously this calculation could overflow, leading to panicking in `debug`.
This commit is contained in:
parent
7b4fb9da88
commit
391da3f3b2
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ impl<'a, SP: Sized, Sc: 'a + ScoreLookUp<ScoreParams = SP>, S: Deref<Target = Sc
|
|||
source, target, short_channel_id
|
||||
) {
|
||||
let usage = ChannelUsage {
|
||||
inflight_htlc_msat: usage.inflight_htlc_msat + used_liquidity,
|
||||
inflight_htlc_msat: usage.inflight_htlc_msat.saturating_add(used_liquidity),
|
||||
..usage
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue