aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-01-24 14:13:45 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:56 +0800
commit6f9f78e54ceb93db5495a3e15568efbfa9e5b25b (patch)
tree2bfc87b64a730a309667aaf103677e0547bc0637 /dex/handler.go
parent974da0184e48f9c393d4ac5974d692f2fe8751cb (diff)
downloaddexon-6f9f78e54ceb93db5495a3e15568efbfa9e5b25b.tar.gz
dexon-6f9f78e54ceb93db5495a3e15568efbfa9e5b25b.tar.zst
dexon-6f9f78e54ceb93db5495a3e15568efbfa9e5b25b.zip
dex: reduce pullVote (#172)
Diffstat (limited to 'dex/handler.go')
-rw-r--r--dex/handler.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/dex/handler.go b/dex/handler.go
index b8b39c6f4..df5516f62 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
)
@@ -1115,7 +1116,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)