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.
This commit is contained in:
Olaoluwa Osuntokun 2017-02-06 14:58:38 -08:00
parent bf78122dc7
commit 38d8d37395
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

View File

@ -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