aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-01-24 14:13:45 +0800
committerGitHub <noreply@github.com>2019-01-24 14:13:45 +0800
commitd60075505d75de052905caad3562ead280d83199 (patch)
treeed75cf7939832143319cc0814feb3032516c92a2
parent0e10299c7138e7a290f885638b25ac1e046ec3f5 (diff)
downloaddexon-d60075505d75de052905caad3562ead280d83199.tar.gz
dexon-d60075505d75de052905caad3562ead280d83199.tar.zst
dexon-d60075505d75de052905caad3562ead280d83199.zip
dex: reduce pullVote (#172)
-rw-r--r--dex/handler.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/dex/handler.go b/dex/handler.go
index 1ea6371ba..d3020cf98 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -79,7 +79,8 @@ const (
recordChanSize = 10240
- maxPullPeers = 3
+ maxPullPeers = 3
+ maxPullVotePeers = 1
pullVoteRateLimit = 10 * time.Second
)
@@ -1120,7 +1121,7 @@ func (pm *ProtocolManager) BroadcastPullVotes(
round: pos.Round,
}
for idx, peer := range pm.peers.PeersWithLabel(label) {
- if idx >= maxPullPeers {
+ if idx >= maxPullVotePeers {
break
}
peer.AsyncSendPullVotes(pos)