server: signal SyncManager with new peer within AddPeer
This makes the logic a bit more unified as previously it was possible we for us to report the new peer to the SyncManager, but for whatever reason failed to track the peer in the server internally within AddPeer. This change ensures this can no longer happen.
This commit is contained in:
parent
07282a6656
commit
11b84f5cb5
1 changed files with 3 additions and 3 deletions
|
@ -490,9 +490,6 @@ func (sp *serverPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgRej
|
|||
// the local clock to keep the network time in sync.
|
||||
sp.server.timeSource.AddTimeSample(sp.Addr(), msg.Timestamp)
|
||||
|
||||
// Signal the sync manager this peer is a new sync candidate.
|
||||
sp.server.syncManager.NewPeer(sp.Peer)
|
||||
|
||||
// Choose whether or not to relay transactions before a filter command
|
||||
// is received.
|
||||
sp.setDisableRelayTx(msg.DisableRelayTx)
|
||||
|
@ -1657,6 +1654,9 @@ func (s *server) handleAddPeerMsg(state *peerState, sp *serverPeer) bool {
|
|||
s.addrManager.Connected(sp.NA())
|
||||
}
|
||||
|
||||
// Signal the sync manager this peer is a new sync candidate.
|
||||
s.syncManager.NewPeer(sp.Peer)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue