Skip to content

Commit

Permalink
Remove duplicated condition for useless peers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Kalina committed Aug 12, 2023
1 parent 2ef5800 commit 5f1d5af
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions gossip/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f1d5af

Please sign in to comment.