diff --git a/src/llmq/ehf_signals.cpp b/src/llmq/ehf_signals.cpp index 7dd42bf2a4106..bf84b8d65a34d 100644 --- a/src/llmq/ehf_signals.cpp +++ b/src/llmq/ehf_signals.cpp @@ -93,7 +93,7 @@ void CEHFSignalsHandler::trySignEHFSignal(int bit, const CBlockIndex* const pind const uint256 msgHash = mnhfPayload.PrepareTx().GetHash(); WITH_LOCK(cs, ids.insert(requestId)); - sigman.AsyncSignIfMember(llmqType, shareman, requestId, msgHash); + sigman.AsyncSignIfMember(llmqType, shareman, requestId, msgHash, quorum->qc->quorumHash, false, true); } void CEHFSignalsHandler::HandleNewRecoveredSig(const CRecoveredSig& recoveredSig) diff --git a/src/llmq/signing.cpp b/src/llmq/signing.cpp index c15137a22fa9d..8200146d320f1 100644 --- a/src/llmq/signing.cpp +++ b/src/llmq/signing.cpp @@ -876,7 +876,9 @@ void CSigningManager::UnregisterRecoveredSigsListener(CRecoveredSigsListener* l) recoveredSigsListeners.erase(itRem, recoveredSigsListeners.end()); } -bool CSigningManager::AsyncSignIfMember(Consensus::LLMQType llmqType, CSigSharesManager& shareman, const uint256& id, const uint256& msgHash, const uint256& quorumHash, bool allowReSign) +bool CSigningManager::AsyncSignIfMember(Consensus::LLMQType llmqType, CSigSharesManager& shareman, const uint256& id, + const uint256& msgHash, const uint256& quorumHash, bool allowReSign, + bool allowDiffMsgHashSigning) { if (m_mn_activeman == nullptr) return false; if (m_mn_activeman->GetProTxHash().IsNull()) return false; @@ -911,9 +913,15 @@ bool CSigningManager::AsyncSignIfMember(Consensus::LLMQType llmqType, CSigShares uint256 prevMsgHash; db.GetVoteForId(llmqType, id, prevMsgHash); if (msgHash != prevMsgHash) { - LogPrintf("CSigningManager::%s -- already voted for id=%s and msgHash=%s. Not voting on conflicting msgHash=%s\n", __func__, - id.ToString(), prevMsgHash.ToString(), msgHash.ToString()); - return false; + if (allowDiffMsgHashSigning) { + LogPrintf("CSigningManager::%s -- already voted for id=%s and msgHash=%s. Signing for different msgHash=%s\n", + __func__, id.ToString(), prevMsgHash.ToString(), msgHash.ToString()); + hasVoted = false; + } else { + LogPrintf("CSigningManager::%s -- already voted for id=%s and msgHash=%s. Not voting on conflicting msgHash=%s\n", + __func__, id.ToString(), prevMsgHash.ToString(), msgHash.ToString()); + return false; + } } else if (allowReSign) { LogPrint(BCLog::LLMQ, "CSigningManager::%s -- already voted for id=%s and msgHash=%s. Resigning!\n", __func__, id.ToString(), prevMsgHash.ToString()); diff --git a/src/llmq/signing.h b/src/llmq/signing.h index 16d24ef5c0ddb..ae2fd48224d41 100644 --- a/src/llmq/signing.h +++ b/src/llmq/signing.h @@ -218,7 +218,9 @@ class CSigningManager void RegisterRecoveredSigsListener(CRecoveredSigsListener* l); void UnregisterRecoveredSigsListener(CRecoveredSigsListener* l); - bool AsyncSignIfMember(Consensus::LLMQType llmqType, CSigSharesManager& shareman, const uint256& id, const uint256& msgHash, const uint256& quorumHash = uint256(), bool allowReSign = false); + bool AsyncSignIfMember(Consensus::LLMQType llmqType, CSigSharesManager& shareman, const uint256& id, + const uint256& msgHash, const uint256& quorumHash = uint256(), bool allowReSign = false, + bool allowDiffMsgHashSigning = false); bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256& id, const uint256& msgHash) const; bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256& id) const; bool HasRecoveredSigForSession(const uint256& signHash) const;