@@ -956,7 +956,7 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerU
956956 min_liquidity_offset_history : & dir_liq. min_liquidity_offset_history ,
957957 max_liquidity_offset_history : & dir_liq. max_liquidity_offset_history ,
958958 } ;
959- let ( min_buckets, mut max_buckets, _) = buckets. get_decayed_buckets ( T :: now ( ) ,
959+ let ( min_buckets, mut max_buckets, _) = buckets. get_decayed_buckets ( dir_liq . now ,
960960 * dir_liq. last_updated , self . decay_params . historical_no_updates_half_life ) ;
961961 // Note that the liquidity buckets are an offset from the edge, so we inverse
962962 // the max order to get the probabilities from zero.
@@ -983,18 +983,18 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerU
983983 if let Some ( chan) = graph. channels ( ) . get ( & scid) {
984984 if let Some ( liq) = self . channel_liquidities . get ( & scid) {
985985 if let Some ( ( directed_info, source) ) = chan. as_directed_to ( target) {
986- let cap = directed_info. effective_capacity ( ) . as_msat ( ) ;
987- let dir_liq = liq. as_directed ( source, target, 0 , cap , self . decay_params ) ;
986+ let capacity_msat = directed_info. effective_capacity ( ) . as_msat ( ) ;
987+ let dir_liq = liq. as_directed ( source, target, 0 , capacity_msat , self . decay_params ) ;
988988
989989 let buckets = HistoricalMinMaxBuckets {
990990 min_liquidity_offset_history : & dir_liq. min_liquidity_offset_history ,
991991 max_liquidity_offset_history : & dir_liq. max_liquidity_offset_history ,
992992 } ;
993993
994- let prob_bill = buckets. calculate_success_probability_times_billion ( T :: now ( ) ,
994+ return buckets. calculate_success_probability_times_billion ( dir_liq . now ,
995995 * dir_liq. last_updated , self . decay_params . historical_no_updates_half_life ,
996- amount_msat, directed_info . effective_capacity ( ) . as_msat ( ) ) ;
997- return prob_bill . map ( |p| p as f64 / ( 1024 * 1024 * 1024 ) as f64 ) ;
996+ amount_msat, capacity_msat
997+ ) . map ( |p| p as f64 / ( 1024 * 1024 * 1024 ) as f64 ) ;
998998 }
999999 }
10001000 }
0 commit comments