Skip to content

Commit 03d34b3

Browse files
committed
f add more color to why we care about special-casing 0
1 parent eebccc6 commit 03d34b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lightning/src/routing/scoring.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,11 @@ mod bucketed_history {
17821782
let mut cumulative_success_prob_times_billion = 0;
17831783
// Special-case the 0th min bucket - it generally means we failed a payment, so only
17841784
// consider the highest (i.e. largest-offset-from-max-capacity) max bucket for all
1785-
// points against the 0th min bucket!
1785+
// points against the 0th min bucket. This avoids the case where we fail to route
1786+
// increasingly lower values over a channel, but treat each failure as a separate
1787+
// datapoint, many of which may have relatively high maximum-available-liquidity
1788+
// values, which will result in us thinking we have some nontrivial probability of
1789+
// routing up to that amount.
17861790
if self.min_liquidity_offset_history.buckets[0] != 0 {
17871791
let mut highest_max_bucket_with_points = 0;
17881792
let mut total_max_points = 0;

0 commit comments

Comments
 (0)