Fix CSigningManager::VerifyRecoveredSig (#3546)

This commit is contained in:
UdjinM6 2020-06-24 11:04:10 +03:00 committed by GitHub
parent aab4852801
commit 955e3868fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -938,14 +938,12 @@ CQuorumCPtr CSigningManager::SelectQuorumForSigning(Consensus::LLMQType llmqType
bool CSigningManager::VerifyRecoveredSig(Consensus::LLMQType llmqType, int signedAtHeight, const uint256& id, const uint256& msgHash, const CBLSSignature& sig)
{
auto& llmqParams = Params().GetConsensus().llmqs.at(Params().GetConsensus().llmqTypeChainLocks);
auto quorum = SelectQuorumForSigning(llmqParams.type, signedAtHeight, id);
auto quorum = SelectQuorumForSigning(llmqType, signedAtHeight, id);
if (!quorum) {
return false;
}
uint256 signHash = CLLMQUtils::BuildSignHash(llmqParams.type, quorum->qc.quorumHash, id, msgHash);
uint256 signHash = CLLMQUtils::BuildSignHash(llmqType, quorum->qc.quorumHash, id, msgHash);
return sig.VerifyInsecure(quorum->qc.quorumPublicKey, signHash);
}