Skip to content

Commit ca1dcb6

Browse files
committed
Update history bucket last_update time immediately on update
Now that we aren't decaying during scoring, when we set the last_updated time in the history bucket logic doesn't matter, so we should just update it when we've just updated the history buckets.
1 parent d562f48 commit ca1dcb6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lightning/src/routing/scoring.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
13191319
self.liquidity_history.max_liquidity_offset_history.track_datapoint(
13201320
max_liquidity_offset_msat.saturating_sub(bucket_offset_msat), self.capacity_msat
13211321
);
1322+
*self.offset_history_last_updated = self.now;
13221323
}
13231324

13241325
/// Adjusts the lower bound of the channel liquidity balance in this direction.
@@ -1330,7 +1331,6 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
13301331
self.decayed_offset_msat(*self.max_liquidity_offset_msat)
13311332
};
13321333
*self.last_updated = self.now;
1333-
*self.offset_history_last_updated = self.now;
13341334
}
13351335

13361336
/// Adjusts the upper bound of the channel liquidity balance in this direction.
@@ -1342,7 +1342,6 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
13421342
self.decayed_offset_msat(*self.min_liquidity_offset_msat)
13431343
};
13441344
*self.last_updated = self.now;
1345-
*self.offset_history_last_updated = self.now;
13461345
}
13471346
}
13481347

0 commit comments

Comments
 (0)