server: mark address attempted on attempt rather than upon connection
We should mark addresses as attempted when we attempt to connect to them, not once we establish a connection with said address.
This commit is contained in:
parent
988181ef23
commit
06baabe5da
1 changed files with 3 additions and 1 deletions
|
@ -2032,7 +2032,6 @@ func (s *server) outboundPeerConnected(c *connmgr.ConnReq, conn net.Conn) {
|
|||
sp.isWhitelisted = isWhitelisted(conn.RemoteAddr())
|
||||
sp.AssociateConnection(conn)
|
||||
go s.peerDoneHandler(sp)
|
||||
s.addrManager.Attempt(sp.NA())
|
||||
}
|
||||
|
||||
// peerDoneHandler handles peer disconnects by notifiying the server that it's
|
||||
|
@ -2802,6 +2801,9 @@ func newServer(listenAddrs, agentBlacklist, agentWhitelist []string,
|
|||
continue
|
||||
}
|
||||
|
||||
// Mark an attempt for the valid address.
|
||||
s.addrManager.Attempt(addr.NetAddress())
|
||||
|
||||
addrString := addrmgr.NetAddressKey(addr.NetAddress())
|
||||
return addrStringToNetAddr(addrString)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue