routing+refactor: remove the need to give CachedGraph source node access

In preparation for the next commit.
This commit is contained in:
Elle Mouton committed 2024-07-15 13:10:24 +02:00
1 parent 3f121cbe81
commit 90d6b863a8
6 files changed
+15 -46

No files matched your search

+4 -5
View File
@@ -691,9 +691,7 @@ func (r *rpcServer) addDeps(s *server, macService *macaroons.Service,
FetchAmountPairCapacity: func(nodeFrom, nodeTo route.Vertex,
amount lnwire.MilliSatoshi) (btcutil.Amount, error) {
routingGraph, err := routing.NewCachedGraph(
selfNode, graph,
)
routingGraph, err := routing.NewCachedGraph(graph)
if err != nil {
return 0, err
}
@@ -706,8 +704,9 @@ func (r *rpcServer) addDeps(s *server, macService *macaroons.Service,
}
}()
return routingGraph.FetchAmountPairCapacity(
nodeFrom, nodeTo, amount,
return routing.FetchAmountPairCapacity(
routingGraph, selfNode.PubKeyBytes, nodeFrom,
nodeTo, amount,
)
},
FetchChannelEndpoints: func(chanID uint64) (route.Vertex,