diff --git a/server.go b/server.go index 7fe114b1..42f34da5 100644 --- a/server.go +++ b/server.go @@ -406,9 +406,10 @@ func (sp *serverPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgRej // it is updated regardless in the case a new minimum protocol version is // enforced and the remote node has not upgraded yet. isInbound := sp.Inbound() + remoteAddr := sp.NA() addrManager := sp.server.addrManager if !cfg.SimNet && !isInbound { - addrManager.SetServices(sp.NA(), msg.Services) + addrManager.SetServices(remoteAddr, msg.Services) } // Ignore peers that have a protcol version that is too old. The peer @@ -457,7 +458,7 @@ func (sp *serverPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgRej // connections and it believes itself to be close to the best known tip. if !cfg.DisableListen && sp.server.syncManager.IsCurrent() { // Get address that best matches. - lna := addrManager.GetBestLocalAddress(sp.NA()) + lna := addrManager.GetBestLocalAddress(remoteAddr) if addrmgr.IsRoutable(lna) { // Filter addresses the peer already knows about. addresses := []*wire.NetAddress{lna} @@ -474,7 +475,7 @@ func (sp *serverPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgRej } // Mark the address as a known good address. - addrManager.Good(sp.NA()) + addrManager.Good(remoteAddr) } // Add the remote peer time as a sample for creating an offset against