consensus: verify timeout from epochInfo instead of snap.NextEpochCandidates, close XFN-62 (#1850)

* use epochInfo.Masternodes instead of snap.NextEpochCandidates

* remove missing snapshot test (now irrelevant)

* add masternodes length check in getEpochSwitchInfo

* get blockhash directly from vote object
This commit is contained in:
Wanwiset Peerapatanapokin 2025-12-23 14:54:54 +04:00 committed by GitHub
parent 0f682a8356
commit 9a61a4958d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@ func (x *XDPoS_v2) VerifyVoteMessage(chain consensus.ChainReader, vote *types.Vo
return false, nil
}
epochInfo, err := x.getEpochSwitchInfo(chain, chain.CurrentHeader(), chain.CurrentHeader().Hash())
epochInfo, err := x.getEpochSwitchInfo(chain, nil, vote.ProposedBlockInfo.Hash)
if err != nil {
log.Error("[VerifyVoteMessage] Fail to get epochInfo when verifying vote message!", "blockNum", vote.ProposedBlockInfo.Number, "blockHash", vote.ProposedBlockInfo.Hash, "voteHash", vote.Hash(), "voteGapNumber", vote.GapNumber, "err", err)
return false, err