From 9a61a4958dadda7d237dd7d771e0d1e88c613085 Mon Sep 17 00:00:00 2001 From: Wanwiset Peerapatanapokin Date: Tue, 23 Dec 2025 14:54:54 +0400 Subject: [PATCH] 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 --- consensus/XDPoS/engines/engine_v2/vote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/XDPoS/engines/engine_v2/vote.go b/consensus/XDPoS/engines/engine_v2/vote.go index 6d9a8b41ed..5bfad88155 100644 --- a/consensus/XDPoS/engines/engine_v2/vote.go +++ b/consensus/XDPoS/engines/engine_v2/vote.go @@ -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