Skip to content

Commit 67f3c66

Browse files
committed
f improve if readability gleb suggested
1 parent 40d8c05 commit 67f3c66

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lightning/src/routing/router.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -938,13 +938,12 @@ pub fn get_route<L: Deref>(our_node_id: &PublicKey, network: &NetworkGraph, paye
938938
// because we deterministically terminated the search due to low liquidity.
939939
if already_collected_value_msat >= recommended_value_msat || !found_new_path {
940940
break 'paths_collection;
941-
}
942-
// Further, if this was our first walk of the graph, and we weren't limited by an
943-
// htlc_minimum_msat, return immediately because this path should suffice. If we were
944-
// limited by an htlc_minimum_msat value, find another path with a higher value,
945-
// potentially allowing us to pay fees to meet the htlc_minimum while still keeping a lower
946-
// total fee.
947-
if already_collected_value_msat == final_value_msat && payment_paths.len() == 1 {
941+
} else if found_new_path && already_collected_value_msat == final_value_msat && payment_paths.len() == 1 {
942+
// Further, if this was our first walk of the graph, and we weren't limited by an
943+
// htlc_minimum_msat, return immediately because this path should suffice. If we were
944+
// limited by an htlc_minimum_msat value, find another path with a higher value,
945+
// potentially allowing us to pay fees to meet the htlc_minimum while still keeping a lower
946+
// total fee.
948947
if !hit_minimum_limit {
949948
break 'paths_collection;
950949
}

0 commit comments

Comments
 (0)