routing: use routingGraph interface in payment session
Preparation for more test coverage of payment session. The function findPath now has the call signature of the former findPathInternal function.
This commit is contained in:
9 files changed
+155
-146
No files matched your search
+15
-3
@@ -1426,13 +1426,25 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
|
||||
// execute our path finding algorithm.
|
||||
finalHtlcExpiry := currentHeight + int32(finalExpiry)
|
||||
|
||||
routingTx, err := newDbRoutingTx(r.cfg.Graph)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
err := routingTx.close()
|
||||
if err != nil {
|
||||
log.Errorf("Error closing db tx: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
path, err := findPath(
|
||||
&graphParams{
|
||||
graph: r.cfg.Graph,
|
||||
bandwidthHints: bandwidthHints,
|
||||
additionalEdges: routeHints,
|
||||
bandwidthHints: bandwidthHints,
|
||||
graph: routingTx,
|
||||
},
|
||||
restrictions, &r.cfg.PathFindingConfig,
|
||||
restrictions,
|
||||
&r.cfg.PathFindingConfig,
|
||||
source, target, amt, finalHtlcExpiry,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user