mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix: refuse to create new clsig if we switched to a different fork while we were signing
This commit is contained in:
parent
dd96032e12
commit
0fc0beca0e
@ -519,7 +519,11 @@ MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CR
|
|||||||
// already got the same or a better CLSIG through the CLSIG message
|
// already got the same or a better CLSIG through the CLSIG message
|
||||||
return {};
|
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());
|
clsig = CChainLockSig(lastSignedHeight, lastSignedMsgHash, recoveredSig.sig.Get());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user