From 21a4e21863a47c63c2d00e967ddc72ee9d6dfb47 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Mon, 27 Aug 2018 21:54:15 -0700 Subject: [PATCH] server: stop requesting initial graph sync In this commit, we remove signaling for initial routing dumps, which create unnecessary log spam, bandwidth, and CPU. Now that gossip syncing is in full force, we will instead opt to use the more efficient querying/set reconciliation. Other nodes may still request initial gossip sync from us, and we will respond. --- server.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/server.go b/server.go index 3ed06838..d57dfcf2 100644 --- a/server.go +++ b/server.go @@ -1967,17 +1967,6 @@ func (s *server) nextPeerBackoff(pubStr string, return defaultBackoff } -// shouldRequestGraphSync returns true if the servers deems it necessary that -// we sync channel graph state with the remote peer. This method is used to -// avoid _always_ syncing channel graph state with each peer that connects. -// -// NOTE: This MUST be called with the server's mutex held. -func (s *server) shouldRequestGraphSync() bool { - // Initially, we'll only request a graph sync iff we have less than two - // peers. - return len(s.peersByPub) <= 2 -} - // shouldDropConnection determines if our local connection to a remote peer // should be dropped in the case of concurrent connection establishment. In // order to deterministically decide which connection should be dropped, we'll @@ -2265,14 +2254,6 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq, localFeatures.Set(lnwire.DataLossProtectOptional) localFeatures.Set(lnwire.GossipQueriesOptional) - // We'll only request a full channel graph sync if we detect that that - // we aren't fully synced yet. - if s.shouldRequestGraphSync() { - // TODO(roasbeef): only do so if gossiper doesn't have active - // peers? - localFeatures.Set(lnwire.InitialRoutingSync) - } - // Now that we've established a connection, create a peer, and it to // the set of currently active peers. p, err := newPeer(conn, connReq, s, peerAddr, inbound, localFeatures)