@@ -557,7 +557,7 @@ const AMOUNT_PENALTY_DIVISOR: u64 = 1 << 20;
557
557
impl < L : Deref < Target = u64 > , T : Time , U : Deref < Target = T > > DirectedChannelLiquidity < L , T , U > {
558
558
/// Returns a penalty for routing the given HTLC `amount_msat` through the channel in this
559
559
/// direction.
560
- fn penalty_msat ( & self , amount_msat : u64 , params : ProbabilisticScoringParameters ) -> u64 {
560
+ fn penalty_msat ( & self , amount_msat : u64 , params : & ProbabilisticScoringParameters ) -> u64 {
561
561
let max_liquidity_msat = self . max_liquidity_msat ( ) ;
562
562
let min_liquidity_msat = core:: cmp:: min ( self . min_liquidity_msat ( ) , max_liquidity_msat) ;
563
563
if amount_msat <= min_liquidity_msat {
@@ -594,7 +594,7 @@ impl<L: Deref<Target = u64>, T: Time, U: Deref<Target = T>> DirectedChannelLiqui
594
594
#[ inline( always) ]
595
595
fn combined_penalty_msat (
596
596
& self , amount_msat : u64 , negative_log10_times_2048 : u64 ,
597
- params : ProbabilisticScoringParameters
597
+ params : & ProbabilisticScoringParameters
598
598
) -> u64 {
599
599
let liquidity_penalty_msat = {
600
600
// Upper bound the liquidity penalty to ensure some channel is selected.
@@ -706,7 +706,7 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for Probabilis
706
706
. get ( & short_channel_id)
707
707
. unwrap_or ( & ChannelLiquidity :: new ( ) )
708
708
. as_directed ( source, target, capacity_msat, liquidity_offset_half_life)
709
- . penalty_msat ( amount_msat, self . params . clone ( ) )
709
+ . penalty_msat ( amount_msat, & self . params )
710
710
}
711
711
712
712
fn payment_path_failed ( & mut self , path : & [ & RouteHop ] , short_channel_id : u64 ) {
0 commit comments