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> {
494
494
}
495
495
496
496
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 ( ) )
501
498
}
502
499
503
500
fn get_total_fee_paid_msat ( & self ) -> u64 {
@@ -1478,8 +1475,8 @@ where L::Target: Logger {
1478
1475
1479
1476
// First, we drop some expensive low-value paths entirely if possible, since fewer
1480
1477
// 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.
1483
1480
cur_route. sort_unstable_by ( |a, b| {
1484
1481
a. get_value_msat ( ) . cmp ( & b. get_value_msat ( ) )
1485
1482
// Reverse ordering for fees, so we drop higher-fee paths first
You can’t perform that action at this time.
0 commit comments