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
2018-10-24 14:06:12 -07:00
parent 640fe2558b
commit 20b9d5d000
4 changed files with 183 additions and 46 deletions

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)