autopilot: implement cached ChannelGraph

Using the cached implementation of a ChannelGraph greatly speeds up the
conversion of the channel database to a SimpleGraph.
This commit is contained in:
bitromortac
2021-12-04 12:28:07 +01:00
parent 52d56a8990
commit 45a2dc80c8
2 changed files with 91 additions and 1 deletions

View File

@ -5905,7 +5905,7 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
}
// Graph diameter.
channelGraph := autopilot.ChannelGraphFromDatabase(graph)
channelGraph := autopilot.ChannelGraphFromCachedDatabase(graph)
simpleGraph, err := autopilot.NewSimpleGraph(channelGraph)
if err != nil {
return nil, err