aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
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 /p2p
parent6a2fec5309e14df6b5fcd0fb76d5b123565d40d4 (diff)
downloadgo-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.gz
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.bz2
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.lz
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.xz
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.tar.zst
go-tangerine-3e2a928caa74e523f43e14eec9918033ac1cbe0a.zip
p2p: stop dialing at half the maximum peer count
Diffstat (limited to 'p2p')
-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() {