Skip to content

Commit 56339be

Browse files
committed
f - Fix decay in mutators
1 parent 159ab47 commit 56339be

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

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

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

0 commit comments

Comments
 (0)