server: Respect the initial_routing_sync feature bit.

Only synchronize routing info with peer if they request it by setting
the appropriate local feature bit.
This commit is contained in:
Jim Posen 2017-10-11 11:38:45 -07:00 committed by Olaoluwa Osuntokun
parent 9fd77a6e40
commit ee49cdd103

View File

@ -1341,10 +1341,12 @@ func (s *server) addPeer(p *peer) {
s.wg.Add(1)
go s.peerTerminationWatcher(p)
// Once the peer has been added to our indexes, send a message to the
// channel router so we can synchronize our view of the channel graph
// with this new peer.
go s.authGossiper.SynchronizeNode(p.addr.IdentityKey)
if p.theirLocalFeatures.HasFeature(lnwire.InitialRoutingSync) {
// Once the peer has been added to our indexes, send a message to the
// channel router so we can synchronize our view of the channel graph
// with this new peer.
go s.authGossiper.SynchronizeNode(p.addr.IdentityKey)
}
// Check if there are listeners waiting for this peer to come online.
for _, con := range s.peerConnectedListeners[pubStr] {