From 38d8d37395cbfbd12195abb6c2637f44a90d45ed Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 6 Feb 2017 14:58:38 -0800 Subject: [PATCH] server: asynchronously synchronize graph state with peers on connect This commit modifies the existing syncing logic to launch a new goroutine on connect to synchronize graph state with the new peer rather than the prior blocking version. This change should make the initial sync a little snappier and also possible eliminate a circular dependency between the ChannelRouter and the server. --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index 26cf06b83..eea70275c 100644 --- a/server.go +++ b/server.go @@ -503,7 +503,7 @@ func (s *server) addPeer(p *peer) { // 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. - s.chanRouter.SynchronizeNode(p.addr.IdentityKey) + go s.chanRouter.SynchronizeNode(p.addr.IdentityKey) } // removePeer removes the passed peer from the server's state of all active