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:
4 files changed
+183
-46
No files matched your search
@@ -406,9 +406,17 @@ func (p *paymentSession) RequestRoute(payment *LightningPayment,
|
||||
// to our destination, respecting the recommendations from
|
||||
// missionControl.
|
||||
path, err := findPath(
|
||||
nil, p.mc.graph, p.additionalEdges, p.mc.selfNode,
|
||||
payment.Target, pruneView.vertexes, pruneView.edges,
|
||||
payment.Amount, payment.FeeLimit, p.bandwidthHints,
|
||||
&graphParams{
|
||||
graph: p.mc.graph,
|
||||
additionalEdges: p.additionalEdges,
|
||||
bandwidthHints: p.bandwidthHints,
|
||||
},
|
||||
&restrictParams{
|
||||
ignoredNodes: pruneView.vertexes,
|
||||
ignoredEdges: pruneView.edges,
|
||||
feeLimit: payment.FeeLimit,
|
||||
},
|
||||
p.mc.selfNode, payment.Target, payment.Amount,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user