File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -494,10 +494,7 @@ impl<'a> PaymentPath<'a> {
494494 }
495495
496496 fn get_path_penalty_msat ( & self ) -> u64 {
497- if self . hops . len ( ) < 1 {
498- return u64:: max_value ( ) ;
499- }
500- self . hops . first ( ) . unwrap ( ) . 0 . path_penalty_msat
497+ self . hops . first ( ) . map ( |h| h. 0 . path_penalty_msat ) . unwrap_or ( u64:: max_value ( ) )
501498 }
502499
503500 fn get_total_fee_paid_msat ( & self ) -> u64 {
@@ -1478,8 +1475,8 @@ where L::Target: Logger {
14781475
14791476 // First, we drop some expensive low-value paths entirely if possible, since fewer
14801477 // paths is better: the payment is less likely to fail. In order to do so, we sort
1481- // by value and fall back to total fees paid, i.e., in case of equal values values
1482- // we prefer lower cost paths.
1478+ // by value and fall back to total fees paid, i.e., in case of equal values we
1479+ // prefer lower cost paths.
14831480 cur_route. sort_unstable_by ( |a, b| {
14841481 a. get_value_msat ( ) . cmp ( & b. get_value_msat ( ) )
14851482 // Reverse ordering for fees, so we drop higher-fee paths first
You can’t perform that action at this time.
0 commit comments