From 5f1d5af2c23bff2a05ed368ad4183a9960172af6 Mon Sep 17 00:00:00 2001 From: Jan Kalina Date: Sat, 12 Aug 2023 08:20:42 +0200 Subject: [PATCH] Remove duplicated condition for useless peers --- gossip/handler.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gossip/handler.go b/gossip/handler.go index 787b3fbcc..1d5a48a18 100644 --- a/gossip/handler.go +++ b/gossip/handler.go @@ -788,10 +788,6 @@ func (h *handler) handle(p *peer) error { useless = true discfilter.Ban(p.ID()) } - if !p.Peer.Info().Network.Trusted && useless && h.peers.UselessNum() >= h.maxPeers/10 { - // don't allow more than 10% of useless peers - return p2p.DiscTooManyPeers - } if !p.Peer.Info().Network.Trusted && useless { if h.peers.UselessNum() >= h.maxPeers/10 { // don't allow more than 10% of useless peers