@@ -737,7 +737,7 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
737
737
let negative_log10_times_2048 = NEGATIVE_LOG10_UPPER_BOUND * 2048 ;
738
738
Self :: combined_penalty_msat ( amount_msat, negative_log10_times_2048,
739
739
params. liquidity_penalty_multiplier_msat ,
740
- params. amount_penalty_multiplier_msat )
740
+ params. liquidity_penalty_amount_multiplier_msat )
741
741
. saturating_add ( params. considered_impossible_penalty_msat )
742
742
} else {
743
743
let numerator = ( max_liquidity_msat - amount_msat) . saturating_add ( 1 ) ;
@@ -752,7 +752,7 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
752
752
approx:: negative_log10_times_2048 ( numerator, denominator) ;
753
753
Self :: combined_penalty_msat ( amount_msat, negative_log10_times_2048,
754
754
params. liquidity_penalty_multiplier_msat ,
755
- params. amount_penalty_multiplier_msat )
755
+ params. liquidity_penalty_amount_multiplier_msat )
756
756
}
757
757
} ;
758
758
@@ -776,8 +776,8 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
776
776
// sending less than 1/16th of a channel's capacity, or 1/8th if we used the top of the
777
777
// bucket.
778
778
let mut total_valid_points_tracked = 0 ;
779
- for ( min_idx, min_bucket) in self . min_liquidity_offset_history . iter ( ) . enumerate ( ) {
780
- for max_bucket in self . max_liquidity_offset_history . iter ( ) . take ( 8 - min_idx) {
779
+ for ( min_idx, min_bucket) in self . min_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) {
780
+ for max_bucket in self . max_liquidity_offset_history . buckets . iter ( ) . take ( 8 - min_idx) {
781
781
total_valid_points_tracked += ( * min_bucket as u64 ) * ( * max_bucket as u64 ) ;
782
782
}
783
783
}
@@ -791,8 +791,8 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
791
791
if payment_amt_64th_bucket > 64 { return res; }
792
792
793
793
let mut cumulative_success_prob_billions = 0 ;
794
- for ( min_idx, min_bucket) in self . min_liquidity_offset_history . iter ( ) . enumerate ( ) {
795
- for ( max_idx, max_bucket) in self . max_liquidity_offset_history . iter ( ) . enumerate ( ) . take ( 8 - min_idx) {
794
+ for ( min_idx, min_bucket) in self . min_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) {
795
+ for ( max_idx, max_bucket) in self . max_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) . take ( 8 - min_idx) {
796
796
let bucket_prob_millions = ( * min_bucket as u64 ) * ( * max_bucket as u64 )
797
797
* 1024 * 1024 / total_valid_points_tracked;
798
798
let min_64th_bucket = min_idx as u64 * 9 ;
@@ -2456,7 +2456,7 @@ mod tests {
2456
2456
// Even after we tell the scorer we definitely have enough available liquidity, it will
2457
2457
// still remember that there was some failure in the past, and assign a non-0 penalty.
2458
2458
scorer. payment_path_failed ( & payment_path_for_amount ( 1000 ) . iter ( ) . collect :: < Vec < _ > > ( ) , 43 ) ;
2459
- assert_eq ! ( scorer. channel_penalty_msat( 42 , & source, & target, usage) , 171 ) ;
2459
+ assert_eq ! ( scorer. channel_penalty_msat( 42 , & source, & target, usage) , 198 ) ;
2460
2460
}
2461
2461
2462
2462
#[ test]
0 commit comments