Skip to content

Commit d141f1f

Browse files
committed
fix: refuse to create new clsig if chain tip has changed while we were signing
1 parent dd96032 commit d141f1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/llmq/chainlocks.cpp

Lines changed: 4 additions & 1 deletion
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()->GetBlockHash() != lastSignedMsgHash) {
523+
// chain tip has changed while we were signing
524+
return {};
525+
}
523526

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

0 commit comments

Comments
 (0)