Skip to content

Commit

Permalink
fix: refuse to create new clsig if we switched to a different fork wh…
Browse files Browse the repository at this point in the history
…ile we were signing
  • Loading branch information
UdjinM6 committed Dec 20, 2024
1 parent dd96032 commit 9b6e7c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/llmq/chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CR
// already got the same or a better CLSIG through the CLSIG message
return {};
}

if (m_chainstate.m_chain.Tip()->GetAncestor(lastSignedHeight)->GetBlockHash() != lastSignedMsgHash) {
// we switched to a different fork while we were signing
return {};
}

clsig = CChainLockSig(lastSignedHeight, lastSignedMsgHash, recoveredSig.sig.Get());
}
Expand Down

0 comments on commit 9b6e7c2

Please sign in to comment.