routing/pathfind: ensure max htlc is considered during path finding

In this commit, we update the path finding logic to
ignore a channel if the HTLC value (including the fees
at the point) exceeds the max HTLC value (if set) of the
link.
This commit is contained in:
Valentine Wallace committed 2019-03-01 08:05:27 -08:00
1 parent 348a66ed13
commit 648adaea69
2 files changed
+97

No files matched your search

+7
View File
@@ -576,6 +576,13 @@ func findPath(g *graphParams, r *restrictParams,
return
}
// If this edge was constructed from a hop hint, we won't have access to
// its max HTLC. Therefore, only consider discarding this edge here if
// the field is set.
if edge.MaxHTLC != 0 && edge.MaxHTLC < amountToSend {
return
}
// Compute fee that fromNode is charging. It is based on the
// amount that needs to be sent to the next node in the route.
//