@@ -824,25 +824,25 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
824
824
debug_assert ! ( payment_amt_64th_bucket <= 64 ) ;
825
825
if payment_amt_64th_bucket > 64 { return res; }
826
826
827
- let mut cumulative_success_prob_billions = 0 ;
827
+ let mut cumulative_success_prob_times_billion = 0 ;
828
828
for ( min_idx, min_bucket) in self . min_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) {
829
829
for ( max_idx, max_bucket) in self . max_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) . take ( 8 - min_idx) {
830
- let bucket_prob_millions = ( * min_bucket as u64 ) * ( * max_bucket as u64 )
830
+ let bucket_prob_times_million = ( * min_bucket as u64 ) * ( * max_bucket as u64 )
831
831
* 1024 * 1024 / total_valid_points_tracked;
832
832
let min_64th_bucket = min_idx as u64 * 9 ;
833
833
let max_64th_bucket = ( 7 - max_idx as u64 ) * 9 + 1 ;
834
834
if payment_amt_64th_bucket > max_64th_bucket {
835
835
// Success probability 0, the payment amount is above the max liquidity
836
836
} else if payment_amt_64th_bucket <= min_64th_bucket {
837
- cumulative_success_prob_billions += bucket_prob_millions * 1024 ;
837
+ cumulative_success_prob_times_billion += bucket_prob_times_million * 1024 ;
838
838
} else {
839
- cumulative_success_prob_billions += bucket_prob_millions *
839
+ cumulative_success_prob_times_billion += bucket_prob_times_million *
840
840
( max_64th_bucket - payment_amt_64th_bucket) * 1024 /
841
841
( max_64th_bucket - min_64th_bucket) ;
842
842
}
843
843
}
844
844
}
845
- let historical_negative_log10_times_2048 = approx:: negative_log10_times_2048 ( cumulative_success_prob_billions + 1 , 1024 * 1024 * 1024 ) ;
845
+ let historical_negative_log10_times_2048 = approx:: negative_log10_times_2048 ( cumulative_success_prob_times_billion + 1 , 1024 * 1024 * 1024 ) ;
846
846
res = res. saturating_add ( Self :: combined_penalty_msat ( amount_msat,
847
847
historical_negative_log10_times_2048, params. historical_liquidity_penalty_multiplier_msat ,
848
848
params. historical_liquidity_penalty_amount_multiplier_msat ) ) ;
0 commit comments