Skip to content

Commit

Permalink
Add delay before update vote to prevent potential attack
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang authored and gdmmx committed Feb 11, 2019
1 parent 97d259d commit 022dcdf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions consensus/moca/election/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ func (election *Election) NeighborVoteCount() int {
// updateVote updates self vote and write vote into txVoteChan if self vote
// changes with throttle.
func (election *Election) updateVote() {
time.Sleep(election.MinVotingInterval)

for {
<-election.voteReceived

Expand Down

0 comments on commit 022dcdf

Please sign in to comment.