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.
This commit is contained in:
Matt Corallo 2023-11-29 03:07:54 +00:00
parent 6f8838fe70
commit 5ac68c1af3

View file

@ -1318,6 +1318,7 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
self.liquidity_history.max_liquidity_offset_history.track_datapoint(
max_liquidity_offset_msat.saturating_sub(bucket_offset_msat), self.capacity_msat
);
*self.offset_history_last_updated = self.now;
}
/// Adjusts the lower bound of the channel liquidity balance in this direction.
@ -1329,7 +1330,6 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
self.decayed_offset_msat(*self.max_liquidity_offset_msat)
};
*self.last_updated = self.now;
*self.offset_history_last_updated = self.now;
}
/// Adjusts the upper bound of the channel liquidity balance in this direction.
@ -1341,7 +1341,6 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
self.decayed_offset_msat(*self.min_liquidity_offset_msat)
};
*self.last_updated = self.now;
*self.offset_history_last_updated = self.now;
}
}