Skip to content

Commit

Permalink
fml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Dec 18, 2024
1 parent 18a5da8 commit 714bdc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,14 @@ 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;
assert_eq!(bucket_prob as u64, bucket_prob_times_billion as u64, "{}, {}", total_weight, total_valid_points_tracked);
cumulative_success_prob_times_billion += val;//bucket_prob as u64 * numerator / denominator;
}
}

Expand Down

0 comments on commit 714bdc0

Please sign in to comment.