Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/llmq/signing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,11 @@ bool CSigningManager::GetRecoveredSigForGetData(const uint256& hash, CRecoveredS
void CSigningManager::VerifyAndProcessRecoveredSig(NodeId from, std::shared_ptr<CRecoveredSig> recoveredSig)
{
auto llmq_type = recoveredSig->getLlmqType();
auto quorum = qman.GetQuorum(llmq_type, recoveredSig->getQuorumHash());
const uint256& quorum_hash = recoveredSig->getQuorumHash();

if (!quorum) {
LogPrint(BCLog::LLMQ, "CSigningManager::%s -- quorum %s not found\n", __func__,
recoveredSig->getQuorumHash().ToString());
return;
}
if (!IsQuorumActive(llmq_type, qman, quorum->qc->quorumHash)) {
// Cheap gate first: GetQuorum can rebuild an arbitrary historical quorum on a cache miss,
// so don't let an unsolicited QSIGREC force that work for an inactive hash.
if (!IsQuorumActive(llmq_type, qman, quorum_hash)) {
return;
}

Expand All @@ -383,6 +380,14 @@ void CSigningManager::VerifyAndProcessRecoveredSig(NodeId from, std::shared_ptr<
return;
}

auto quorum = qman.GetQuorum(llmq_type, quorum_hash);
if (!quorum) {
// Active per ScanQuorums but no longer materializable (e.g. reorg); not peer-controlled, so no score.
LogPrint(BCLog::LLMQ, "CSigningManager::%s -- quorum %s not found\n", __func__,
quorum_hash.ToString());
return;
}

LogPrint(BCLog::LLMQ, "CSigningManager::%s -- signHash=%s, id=%s, msgHash=%s, node=%d\n", __func__,
recoveredSig->buildSignHash().ToString(), recoveredSig->getId().ToString(), recoveredSig->getMsgHash().ToString(), from);

Expand Down