diff --git a/routing/pathfind.go b/routing/pathfind.go index 4cebf227..c75aa299 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -490,12 +490,11 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph, // record the new better distance, and also populate // our "next hop" map with this edge. We'll also shave // off irrelevant edges by adding the sufficient - // capacity of an edge to our relaxation condition. + // capacity of an edge and clearing their min-htlc + // amount to our relaxation condition. if tempDist < distance[v].dist && - edgeInfo.Capacity >= amt.ToSatoshis() { - - // TODO(roasbeef): need to also account - // for min HTLC + edgeInfo.Capacity >= amt.ToSatoshis() && + amt >= outEdge.MinHTLC { distance[v] = nodeWithDist{ dist: tempDist, @@ -518,6 +517,8 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph, heap.Push(&nodeHeap, distance[v]) } + // TODO(roasbeef): return min HTLC as error in end? + return nil }) if err != nil { diff --git a/routing/testdata/basic_graph.json b/routing/testdata/basic_graph.json index 06feebfe..64849b63 100644 --- a/routing/testdata/basic_graph.json +++ b/routing/testdata/basic_graph.json @@ -64,7 +64,7 @@ "channel_point": "89dc56859c6a082d15ba1a7f6cb6be3fea62e1746e2cb8497b1189155c21a233:0", "flags": 0, "expiry": 1, - "min_htlc": 1, + "min_htlc": 1000, "fee_base_msat": 10, "fee_rate": 1000, "capacity": 100000