Skip to content

Commit 1191958

Browse files
committed
f clarify comment
1 parent 6bee9bf commit 1191958

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lightning/src/routing/router.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,20 @@ pub fn get_route<L: Deref>(our_node_id: &PublicKey, network: &NetworkGraph, paye
733733
// cheaper fee, check that it was because the second path we
734734
// found (which we are processing now) has a lower value
735735
// contribution due to an HTLC minimum limit.
736+
//
737+
// e.g. take a graph with two paths from node 1 to node 2, one
738+
// through channel A, and one through channel B. Channel A and
739+
// B are both in the to-process heap, with their scores set by
740+
// a higher htlc_minimum than fee.
741+
// Channel A is processed first, and the channels onwards from
742+
// node 1 are added to the to-process heap. Thereafter, we pop
743+
// Channel B off of the heap, note that it has a much more
744+
// restrictive htlc_maximum_msat, and recalculate the fees for
745+
// all of node 1's channels using the new, reduced, amount.
746+
//
747+
// This would be bogus - we'd be selecting a higher-fee path
748+
// with a lower htlc_maximum_msat instead of the one we'd
749+
// already decided to use.
736750
debug_assert!(path_htlc_minimum_msat < old_entry.path_htlc_minimum_msat);
737751
debug_assert!(value_contribution_msat < old_entry.value_contribution_msat);
738752
}

0 commit comments

Comments
 (0)