Skip to content

Commit a147de9

Browse files
committed
f - Fix decay in mutators
1 parent 38dd07e commit a147de9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/routing/scoring.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,24 +697,24 @@ impl<L: DerefMut<Target = u64>, T: Time, U: DerefMut<Target = T>> DirectedChanne
697697

698698
/// Adjusts the lower bound of the channel liquidity balance in this direction.
699699
fn set_min_liquidity_msat(&mut self, amount_msat: u64) {
700-
*self.last_updated = self.now;
701700
*self.min_liquidity_offset_msat = amount_msat;
702701
*self.max_liquidity_offset_msat = if amount_msat > self.max_liquidity_msat() {
703702
0
704703
} else {
705704
self.decayed_offset_msat(*self.max_liquidity_offset_msat)
706705
};
706+
*self.last_updated = self.now;
707707
}
708708

709709
/// Adjusts the upper bound of the channel liquidity balance in this direction.
710710
fn set_max_liquidity_msat(&mut self, amount_msat: u64) {
711-
*self.last_updated = self.now;
712711
*self.max_liquidity_offset_msat = self.capacity_msat.checked_sub(amount_msat).unwrap_or(0);
713712
*self.min_liquidity_offset_msat = if amount_msat < self.min_liquidity_msat() {
714713
0
715714
} else {
716715
self.decayed_offset_msat(*self.min_liquidity_offset_msat)
717-
}
716+
};
717+
*self.last_updated = self.now;
718718
}
719719
}
720720

0 commit comments

Comments
 (0)