aboutsummaryrefslogtreecommitdiffstats
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-03-12 12:19:09 +0800
commitdf60600936084e5c0b795c1a53dd65fa778b37be (patch)
treecd837ee727719bb9f2a389f2d961379169f2d9c5
parentbb9547da675cc6b3e0c526b317d2d4364f5bd35b (diff)
downloaddexon-df60600936084e5c0b795c1a53dd65fa778b37be.tar.gz
dexon-df60600936084e5c0b795c1a53dd65fa778b37be.tar.zst
dexon-df60600936084e5c0b795c1a53dd65fa778b37be.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 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)