Skip to content

Commit b39f1b9

Browse files
committed
Drop unreachable underflow-handling block in route calculation
See comment in the removed block, note that the subsequent subtraction will underflow if the block would otherwise have been reached.
1 parent af756d3 commit b39f1b9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lightning/src/routing/router.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,6 @@ pub fn get_route<L: Deref>(our_node_id: &PublicKey, network: &NetworkGraph, paye
960960
let mut spent_on_hop_msat = value_contribution_msat;
961961
let next_hops_fee_msat = payment_hop.next_hops_fee_msat;
962962
spent_on_hop_msat += next_hops_fee_msat;
963-
if *channel_liquidity_available_msat < spent_on_hop_msat {
964-
// This should not happen because we do recompute fees right before,
965-
// trying to avoid cases when a hop is not usable due to the fee situation.
966-
break 'path_construction;
967-
}
968963
if spent_on_hop_msat == *channel_liquidity_available_msat {
969964
// If this path used all of this channel's available liquidity, we know
970965
// this path will not be selected again in the next loop iteration.

0 commit comments

Comments
 (0)