Commit 3e2a928c authored by Felix Lange's avatar Felix Lange

p2p: stop dialing at half the maximum peer count

parent 6a2fec53
...@@ -360,7 +360,7 @@ func (srv *Server) dialLoop() { ...@@ -360,7 +360,7 @@ func (srv *Server) dialLoop() {
case <-refresh.C: case <-refresh.C:
// Grab some nodes to connect to if we're not at capacity. // Grab some nodes to connect to if we're not at capacity.
srv.lock.RLock() srv.lock.RLock()
needpeers := len(srv.peers) < srv.MaxPeers needpeers := len(srv.peers) < srv.MaxPeers/2
srv.lock.RUnlock() srv.lock.RUnlock()
if needpeers { if needpeers {
go func() { go func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment