aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-07 05:44:51 +0800
committerFelix Lange <fjl@twurst.com>2015-05-07 05:44:51 +0800
commit3e2a928caa74e523f43e14eec9918033ac1cbe0a (patch)
tree2ec0ec48c76b525877a5895cb24467b65adb5a66
parent6a2fec5309e14df6b5fcd0fb76d5b123565d40d4 (diff)
downloaddexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.gz
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.bz2
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.lz
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.xz
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.zst
dexon-3e2a928caa74e523f43e14eec9918033ac1cbe0a.zip
p2p: stop dialing at half the maximum peer count
-rw-r--r--p2p/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/server.go b/p2p/server.go
index e648c72c9..98a2edd7c 100644
--- a/p2p/server.go
+++ b/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() {