Skip to content

Commit

Permalink
fucmillionk
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Dec 18, 2024
1 parent 5ef1356 commit 4cb2eb0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1938,8 +1938,9 @@ 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_billion =
total_weight * 1024 * 1024 * 1024 / total_valid_points_tracked;
let bucket_prob_times_thousand =
total_weight * 1024 / total_valid_points_tracked;
let bucket_prob_times_billion = bucket_prob_times_thousand * 1024 * 1024;
debug_assert!(bucket_prob_times_billion <= 1 << 30);
cumulative_success_prob_times_billion += (bucket_prob_times_billion as u64) *
numerator / denominator;
Expand All @@ -1953,8 +1954,9 @@ mod bucketed_history {
let mut bucket_weight = (*min_bucket as u64) * (*max_bucket as u64);
bucket_weight *= bucket_weight;
debug_assert!(bucket_weight <= total_valid_points_tracked);
let bucket_prob_times_billion =
bucket_weight * 1024 * 1024 * 1024 / total_valid_points_tracked;
let bucket_prob_times_million =
bucket_weight * 1024 * 1024 / total_valid_points_tracked;
let bucket_prob_times_billion = bucket_prob_times_million * 1024;
debug_assert!(bucket_prob_times_billion <= 1 << 30);
if payment_pos >= max_bucket_end_pos {
// Success probability 0, the payment amount may be above the max liquidity
Expand Down

0 comments on commit 4cb2eb0

Please sign in to comment.