mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-717] Fix nodes getting stuck in an infinite loop in addrManager.getAddress (#624)
* [NOD-717] Fix nodes getting stuck in an infinite loop in addrManager.getAddress. * [NOD-717] Rename ResetFailedAttempts -> NotifyConnectionRequestComplete.
This commit is contained in:
parent
3dd7dc4496
commit
5b8ab63890
@ -336,7 +336,6 @@ out:
|
||||
conns[connReq.id] = connReq
|
||||
log.Debugf("Connected to %s", connReq)
|
||||
connReq.retryCount = 0
|
||||
cm.failedAttempts = 0
|
||||
|
||||
delete(pending, connReq.id)
|
||||
|
||||
@ -429,6 +428,13 @@ out:
|
||||
log.Trace("Connection handler done")
|
||||
}
|
||||
|
||||
// NotifyConnectionRequestComplete notifies the connection
|
||||
// manager that a peer had been successfully connected and
|
||||
// marked as good.
|
||||
func (cm *ConnManager) NotifyConnectionRequestComplete() {
|
||||
cm.failedAttempts = 0
|
||||
}
|
||||
|
||||
// NewConnReq creates a new connection request and connects to the
|
||||
// corresponding address.
|
||||
func (cm *ConnManager) NewConnReq() {
|
||||
|
@ -688,6 +688,9 @@ func (s *Server) handleAddPeerMsg(state *peerState, sp *Peer) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// Notify the connection manager.
|
||||
s.connManager.NotifyConnectionRequestComplete()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user