p2p: stop dialing at half the maximum peer count

pull/866/head
Felix Lange 10 years ago
parent 6a2fec5309
commit 3e2a928caa
  1. 2
      p2p/server.go

@ -360,7 +360,7 @@ func (srv *Server) dialLoop() {
case <-refresh.C:
// Grab some nodes to connect to if we're not at capacity.
srv.lock.RLock()
needpeers := len(srv.peers) < srv.MaxPeers
needpeers := len(srv.peers) < srv.MaxPeers/2
srv.lock.RUnlock()
if needpeers {
go func() {

Loading…
Cancel
Save