mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-13 06:29:07 +02:00
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:
parent
bf78122dc7
commit
38d8d37395
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user