Skip to content

Commit fe801c8

Browse files
Merge pull request #743 from XinFinOrg/bug-fix-use-right-block-to-count-vote-theshold
bug fix use right block to count vote threshold
2 parents 962be21 + 8092422 commit fe801c8

File tree

1 file changed

+2
-2
lines changed
  • consensus/XDPoS/engines/engine_v2

1 file changed

+2
-2
lines changed

consensus/XDPoS/engines/engine_v2/vote.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (x *XDPoS_v2) voteHandler(chain consensus.ChainReader, voteMsg *types.Vote)
7676
go x.ForensicsProcessor.DetectEquivocationInVotePool(voteMsg, x.votePool)
7777
go x.ForensicsProcessor.ProcessVoteEquivocation(chain, x, voteMsg)
7878

79-
epochInfo, err := x.getEpochSwitchInfo(chain, chain.CurrentHeader(), chain.CurrentHeader().Hash())
79+
epochInfo, err := x.getEpochSwitchInfo(chain, nil, voteMsg.ProposedBlockInfo.Hash)
8080
if err != nil {
8181
log.Error("[voteHandler] Error when getting epoch switch Info", "error", err)
8282
return errors.New("fail on voteHandler due to failure in getting epoch switch info")
@@ -175,7 +175,7 @@ func (x *XDPoS_v2) onVotePoolThresholdReached(chain consensus.ChainReader, poole
175175
}
176176
}
177177

178-
epochInfo, err := x.getEpochSwitchInfo(chain, chain.CurrentHeader(), chain.CurrentHeader().Hash())
178+
epochInfo, err := x.getEpochSwitchInfo(chain, nil, currentVoteMsg.(*types.Vote).ProposedBlockInfo.Hash)
179179
if err != nil {
180180
log.Error("[voteHandler] Error when getting epoch switch Info", "error", err)
181181
return errors.New("fail on voteHandler due to failure in getting epoch switch info")

0 commit comments

Comments
 (0)