From: Matt Corallo Date: Sun, 16 Apr 2023 04:03:08 +0000 (+0000) Subject: Track "steady-state" channel balances in history buckets not live X-Git-Tag: v0.0.117-alpha1~8^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=2ed21b87faee83946bfd77d3c01c5c1e6fd7d7e9;p=rust-lightning Track "steady-state" channel balances in history buckets not live The lower-bound of the scoring history buckets generally never get used - if we try to send a payment and it fails, we don't learn a new lower-bound for the liquidity of a channel, and if we successfully send a payment we only learn a lower-bound that applied *before* we sent the payment, not after it completed. If we assume channels have some "steady-state" liquidity, then tracking our liquidity estimates *after* a payment doesn't really make sense - we're not super likely to make a second payment across the same channel immediately (or, if we are, we can use our un-decayed liquidity estimates for that). By the time we do go to use the same channel again, we'd assume that its back at its "steady-state" and the impacts of our payment have been lost. To combat both of these effects, here we "subtract" the impact of any just-successful payments from our liquidity estimates prior to updating the historical buckets. --- diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index fda73117..5fd355c2 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -1070,7 +1070,7 @@ impl, BRT: DerefMut, BRT: DerefMut, BRT: DerefMut, BRT: DerefMut