graph/db: let ForEachNodeCached maybe fetch node addresses
Here we adjust the ForEachNodeCached graph DB method to pass in a node's addresses into the provided call-back if requested. This will allow us to improve the performance of node/channel iteration in the autopilot subserver.
This commit is contained in:
9 files changed
+96
-26
No files matched your search
+2
-1
@@ -7183,7 +7183,8 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
|
||||
// network, tallying up the total number of nodes, and also gathering
|
||||
// each node so we can measure the graph diameter and degree stats
|
||||
// below.
|
||||
err := graph.ForEachNodeCached(ctx, func(node route.Vertex,
|
||||
err := graph.ForEachNodeCached(ctx, false, func(ctx context.Context,
|
||||
node route.Vertex, _ []net.Addr,
|
||||
edges map[uint64]*graphdb.DirectedChannel) error {
|
||||
|
||||
// Increment the total number of nodes with each iteration.
|
||||
|
||||
Reference in new issue
Block a user