routing: define graphParams and restrictParams

To avoid the findPath parameter list getting out of hand, we define new
structs that wraps the mandatory and optional parameters to findPath.
This commit is contained in:
Johan T. Halseth committed 2018-12-04 12:20:44 +01:00
1 parent 640fe2558b
commit 20b9d5d000
4 files changed
+183 -46

No files matched your search

+9 -2
View File
@@ -1872,8 +1872,15 @@ func TestFindPathFeeWeighting(t *testing.T) {
// the edge weighting, we should select the direct path over the 2 hop
// path even though the direct path has a higher potential time lock.
path, err := findPath(
nil, ctx.graph, nil, sourceNode, target, ignoreVertex,
ignoreEdge, amt, noFeeLimit, nil,
&graphParams{
graph: ctx.graph,
},
&restrictParams{
ignoredNodes: ignoreVertex,
ignoredEdges: ignoreEdge,
feeLimit: noFeeLimit,
},
sourceNode, target, amt,
)
if err != nil {
t.Fatalf("unable to find path: %v", err)