From 209516a0e6eee07468b1551eb21a501005c3329b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 18 Dec 2024 21:59:40 +0000 Subject: [PATCH] fml --- lightning/src/routing/scoring.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index c61c71b9f46..21060102d38 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -1960,8 +1960,13 @@ mod bucketed_history { if payment_pos < max_bucket_end_pos { let (numerator, denominator) = success_probability(payment_pos as u64, 0, max_bucket_end_pos as u64, POSITION_TICKS as u64 - 1, params, true); + let bucket_prob_times_four = + total_weight * 4 / total_valid_points_tracked; + let bucket_prob_times_billion = bucket_prob_times_four * 1024 * 1024 * 1024 / 4; + let val = (bucket_prob_times_billion as u64) * + numerator / denominator; let bucket_prob = (total_weight as u128) * 1024 * 1024 * 1024 / total_valid_points_tracked as u128; - cumulative_success_prob_times_billion += bucket_prob as u64 * numerator / denominator; + cumulative_success_prob_times_billion += val;//bucket_prob as u64 * numerator / denominator; } }