lnd+graph: add GraphBootstrapper to the GraphSource interface

So that LND can use a different GraphSource for network bootstrapping
and does not need to rely on its local graph db.
This commit is contained in:
Elle Mouton
2024-11-12 08:49:34 +02:00
parent 0f33d41c55
commit 372883ab81
3 changed files with 22 additions and 2 deletions

View File

@@ -2817,6 +2817,7 @@ out:
// based on the server, and currently active bootstrap mechanisms as defined
// within the current configuration.
func initNetworkBootstrappers(s *server) ([]discovery.NetworkPeerBootstrapper, error) {
ctx := context.TODO()
srvrLog.Infof("Initializing peer network bootstrappers!")
var bootStrappers []discovery.NetworkPeerBootstrapper
@@ -2824,8 +2825,7 @@ func initNetworkBootstrappers(s *server) ([]discovery.NetworkPeerBootstrapper, e
// First, we'll create an instance of the ChannelGraphBootstrapper as
// this can be used by default if we've already partially seeded the
// network.
chanGraph := autopilot.ChannelGraphFromDatabase(s.graphDB)
graphBootstrapper, err := discovery.NewGraphBootstrapper(chanGraph)
graphBootstrapper, err := s.graphSource.GraphBootstrapper(ctx)
if err != nil {
return nil, err
}