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; } }