Skip to content

Commit

Permalink
Update history bucket last_update time immediately on update
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheBlueMatt committed Dec 13, 2023
1 parent 6f8838f commit 5ac68c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 5ac68c1

Please sign in to comment.