server: move gossip dispatch to peer
See next commit msg for more detail.
This commit is contained in:
1 file changed
-27
@@ -2364,33 +2364,6 @@ func (s *server) peerInitializer(p *peer) {
|
|||||||
// was successful, and to begin watching the peer's wait group.
|
// was successful, and to begin watching the peer's wait group.
|
||||||
close(ready)
|
close(ready)
|
||||||
|
|
||||||
switch {
|
|
||||||
// If the remote peer knows of the new gossip queries feature, then
|
|
||||||
// we'll create a new gossipSyncer in the AuthenticatedGossiper for it.
|
|
||||||
case p.remoteLocalFeatures.HasFeature(lnwire.GossipQueriesOptional):
|
|
||||||
srvrLog.Infof("Negotiated chan series queries with %x",
|
|
||||||
p.pubKeyBytes[:])
|
|
||||||
|
|
||||||
// We'll only request channel updates from the remote peer if
|
|
||||||
// its enabled in the config, or we're already getting updates
|
|
||||||
// from enough peers.
|
|
||||||
//
|
|
||||||
// TODO(roasbeef): craft s.t. we only get updates from a few
|
|
||||||
// peers
|
|
||||||
recvUpdates := !cfg.NoChanUpdates
|
|
||||||
go s.authGossiper.InitSyncState(p, recvUpdates)
|
|
||||||
|
|
||||||
// If the remote peer has the initial sync feature bit set, then we'll
|
|
||||||
// being the synchronization protocol to exchange authenticated channel
|
|
||||||
// graph edges/vertexes, but only if they don't know of the new gossip
|
|
||||||
// queries.
|
|
||||||
case p.remoteLocalFeatures.HasFeature(lnwire.InitialRoutingSync):
|
|
||||||
srvrLog.Infof("Requesting full table sync with %x",
|
|
||||||
p.pubKeyBytes[:])
|
|
||||||
|
|
||||||
go s.authGossiper.SynchronizeNode(p)
|
|
||||||
}
|
|
||||||
|
|
||||||
pubStr := string(p.addr.IdentityKey.SerializeCompressed())
|
pubStr := string(p.addr.IdentityKey.SerializeCompressed())
|
||||||
|
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
|
|||||||
Reference in new issue
Block a user