Skip to content

Commit 3e2a928

Browse files
committed
p2p: stop dialing at half the maximum peer count
1 parent 6a2fec5 commit 3e2a928

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p2p/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func (srv *Server) dialLoop() {
360360
case <-refresh.C:
361361
// Grab some nodes to connect to if we're not at capacity.
362362
srv.lock.RLock()
363-
needpeers := len(srv.peers) < srv.MaxPeers
363+
needpeers := len(srv.peers) < srv.MaxPeers/2
364364
srv.lock.RUnlock()
365365
if needpeers {
366366
go func() {

0 commit comments

Comments
 (0)