Skip to content

Commit 5ac68c1

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 6f8838f commit 5ac68c1

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
@@ -1318,6 +1318,7 @@ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTrac
13181318
self.liquidity_history.max_liquidity_offset_history.track_datapoint(
13191319
max_liquidity_offset_msat.saturating_sub(bucket_offset_msat), self.capacity_msat
13201320
);
1321+
*self.offset_history_last_updated = self.now;
13211322
}
13221323

13231324
/// 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
13291330
self.decayed_offset_msat(*self.max_liquidity_offset_msat)
13301331
};
13311332
*self.last_updated = self.now;
1332-
*self.offset_history_last_updated = self.now;
13331333
}
13341334

13351335
/// 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
13411341
self.decayed_offset_msat(*self.min_liquidity_offset_msat)
13421342
};
13431343
*self.last_updated = self.now;
1344-
*self.offset_history_last_updated = self.now;
13451344
}
13461345
}
13471346

0 commit comments

Comments
 (0)