We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99b2554 commit 3da2e55Copy full SHA for 3da2e55
lightning/src/routing/router.rs
@@ -1649,8 +1649,8 @@ where L::Target: Logger {
1649
debug_assert_eq!(selected_route.iter().map(|p| p.get_value_msat()).sum::<u64>(), already_collected_value_msat);
1650
let mut overpaid_value_msat = already_collected_value_msat - final_value_msat;
1651
1652
- // First, sort by the cost-per-value of the path, selecting only the paths which
1653
- // contribute the most per cost.
+ // First, sort by the cost-per-value of the path, dropping the paths which cost the most for
+ // the value they contribute towards the payment amount.
1654
// We sort backwards as we will remove from the front in `retain`, next.
1655
selected_route.sort_unstable_by(|a, b|
1656
(((b.get_cost_msat() as u128) << 64) / (b.get_value_msat() as u128))
0 commit comments