diff --git a/pkg/network/server.go b/pkg/network/server.go index a7d5765b6..549605bc1 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -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