diff --git a/server.go b/server.go index 7d5da9c1..eaaa1133 100644 --- a/server.go +++ b/server.go @@ -1651,6 +1651,12 @@ func (s *server) handleAddPeerMsg(state *peerState, sp *serverPeer) bool { } } + // Update the address' last seen time if the peer has acknowledged + // our version and has sent us its version as well. + if sp.VerAckReceived() && sp.VersionKnown() && sp.NA() != nil { + s.addrManager.Connected(sp.NA()) + } + return true } @@ -1681,12 +1687,6 @@ func (s *server) handleDonePeerMsg(state *peerState, sp *serverPeer) { s.connManager.Disconnect(sp.connReq.ID()) } - // Update the address' last seen time if the peer has acknowledged - // our version and has sent us its version as well. - if sp.VerAckReceived() && sp.VersionKnown() && sp.NA() != nil { - s.addrManager.Connected(sp.NA()) - } - // If we get here it means that either we didn't know about the peer // or we purposefully deleted it. }