Skip to content

Commit 22d285d

Browse files
committed
f - Fix decay in mutators
1 parent 5d14da3 commit 22d285d

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
@@ -682,24 +682,24 @@ impl<L: DerefMut<Target = u64>, T: Time, U: DerefMut<Target = T>> DirectedChanne
682682

683683
/// Adjusts the lower bound of the channel liquidity balance in this direction.
684684
fn set_min_liquidity_msat(&mut self, amount_msat: u64) {
685-
*self.last_updated = self.now;
686685
*self.min_liquidity_offset_msat = amount_msat;
687686
*self.max_liquidity_offset_msat = if amount_msat > self.max_liquidity_msat() {
688687
0
689688
} else {
690689
self.decayed_offset_msat(*self.max_liquidity_offset_msat)
691690
};
691+
*self.last_updated = self.now;
692692
}
693693

694694
/// Adjusts the upper bound of the channel liquidity balance in this direction.
695695
fn set_max_liquidity_msat(&mut self, amount_msat: u64) {
696-
*self.last_updated = self.now;
697696
*self.max_liquidity_offset_msat = self.capacity_msat.checked_sub(amount_msat).unwrap_or(0);
698697
*self.min_liquidity_offset_msat = if amount_msat < self.min_liquidity_msat() {
699698
0
700699
} else {
701700
self.decayed_offset_msat(*self.min_liquidity_offset_msat)
702-
}
701+
};
702+
*self.last_updated = self.now;
703703
}
704704
}
705705

0 commit comments

Comments
 (0)