forked from TrueCloudLab/neoneo-go
network: don't reconnect to peers with identical ID
This commit is contained in:
parent
fdd5276d3e
commit
b5fb43bac9
1 changed files with 6 additions and 2 deletions
|
@ -235,8 +235,12 @@ func (s *Server) run() {
|
|||
"peerCount": s.PeerCount(),
|
||||
}).Warn("peer disconnected")
|
||||
addr := drop.peer.PeerAddr().String()
|
||||
s.discovery.UnregisterConnectedAddr(addr)
|
||||
s.discovery.BackFill(addr)
|
||||
if drop.reason == errIdenticalID {
|
||||
s.discovery.RegisterBadAddr(addr)
|
||||
} else {
|
||||
s.discovery.UnregisterConnectedAddr(addr)
|
||||
s.discovery.BackFill(addr)
|
||||
}
|
||||
updatePeersConnectedMetric(s.PeerCount())
|
||||
} else {
|
||||
// else the peer is already gone, which can happen
|
||||
|
|
Loading…
Reference in a new issue