From 6ba4afc97773be7eaf2d1a66e50bc6046bfa0c1b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 17 Nov 2022 16:40:29 +0300 Subject: [PATCH] network: consider handshaked peers only when comparing with MinPeers We don't know a lot about non-handshaked ones, so it's safer to try more connection. --- pkg/network/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index 7210ddf86..be6a1d3a6 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -409,7 +409,7 @@ func (s *Server) run() { // "Optimal" number of peers. optimalN = s.discovery.GetFanOut() * 2 // Real number of peers. - peerN = s.PeerCount() + peerN = s.HandshakedPeersCount() ) if peerN < s.MinPeers {