@@ -574,7 +574,7 @@ const AMOUNT_PENALTY_DIVISOR: u64 = 1 << 20;
574
574
impl < L : Deref < Target = u64 > , T : Time , U : Deref < Target = T > > DirectedChannelLiquidity < L , T , U > {
575
575
/// Returns a penalty for routing the given HTLC `amount_msat` through the channel in this
576
576
/// direction.
577
- fn penalty_msat ( & self , amount_msat : u64 , params : ProbabilisticScoringParameters ) -> u64 {
577
+ fn penalty_msat ( & self , amount_msat : u64 , params : & ProbabilisticScoringParameters ) -> u64 {
578
578
let max_liquidity_msat = self . max_liquidity_msat ( ) ;
579
579
let min_liquidity_msat = core:: cmp:: min ( self . min_liquidity_msat ( ) , max_liquidity_msat) ;
580
580
if amount_msat <= min_liquidity_msat {
@@ -611,7 +611,7 @@ impl<L: Deref<Target = u64>, T: Time, U: Deref<Target = T>> DirectedChannelLiqui
611
611
#[ inline( always) ]
612
612
fn combined_penalty_msat (
613
613
& self , amount_msat : u64 , negative_log10_times_2048 : u64 ,
614
- params : ProbabilisticScoringParameters
614
+ params : & ProbabilisticScoringParameters
615
615
) -> u64 {
616
616
let liquidity_penalty_msat = {
617
617
// Upper bound the liquidity penalty to ensure some channel is selected.
@@ -723,7 +723,7 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for Probabilis
723
723
. get ( & short_channel_id)
724
724
. unwrap_or ( & ChannelLiquidity :: new ( ) )
725
725
. as_directed ( source, target, capacity_msat, liquidity_offset_half_life)
726
- . penalty_msat ( amount_msat, self . params . clone ( ) )
726
+ . penalty_msat ( amount_msat, & self . params )
727
727
}
728
728
729
729
fn payment_path_failed ( & mut self , path : & [ & RouteHop ] , short_channel_id : u64 ) {
0 commit comments