diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index 1b6f56f5c8..bdde25b2f6 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -519,7 +519,11 @@ MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CR // already got the same or a better CLSIG through the CLSIG message return {}; } - + const auto pindex = m_chainstate.m_chain.Tip()->GetAncestor(lastSignedHeight); + if (pindex == nullptr || pindex->GetBlockHash() != lastSignedMsgHash) { + // we switched to a different fork while we were signing + return {}; + } clsig = CChainLockSig(lastSignedHeight, lastSignedMsgHash, recoveredSig.sig.Get()); }