Skip to content

Commit 9b6e7c2

Browse files
committed
fix: refuse to create new clsig if we switched to a different fork while we were signing
1 parent dd96032 commit 9b6e7c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/llmq/chainlocks.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CR
519519
// already got the same or a better CLSIG through the CLSIG message
520520
return {};
521521
}
522-
522+
if (m_chainstate.m_chain.Tip()->GetAncestor(lastSignedHeight)->GetBlockHash() != lastSignedMsgHash) {
523+
// we switched to a different fork while we were signing
524+
return {};
525+
}
523526

524527
clsig = CChainLockSig(lastSignedHeight, lastSignedMsgHash, recoveredSig.sig.Get());
525528
}

0 commit comments

Comments
 (0)