diff --git a/src/llmq/dkgsessionmgr.cpp b/src/llmq/dkgsessionmgr.cpp index 7b81f8c092..47a1af1f89 100644 --- a/src/llmq/dkgsessionmgr.cpp +++ b/src/llmq/dkgsessionmgr.cpp @@ -389,7 +389,6 @@ void CDKGSessionManager::WriteEncryptedContributions(Consensus::LLMQType llmqTyp bool CDKGSessionManager::GetVerifiedContributions(Consensus::LLMQType llmqType, const CBlockIndex* pQuorumBaseBlockIndex, const std::vector& validMembers, std::vector& memberIndexesRet, std::vector& vvecsRet, std::vector& skContributionsRet) const { - LOCK(contributionsCacheCs); auto members = utils::GetAllQuorumMembers(llmqType, pQuorumBaseBlockIndex); memberIndexesRet.clear(); @@ -398,6 +397,9 @@ bool CDKGSessionManager::GetVerifiedContributions(Consensus::LLMQType llmqType, memberIndexesRet.reserve(members.size()); vvecsRet.reserve(members.size()); skContributionsRet.reserve(members.size()); + + // NOTE: the `cs_main` should not be locked under scope of `contributionsCacheCs` + LOCK(contributionsCacheCs); for (const auto i : irange::range(members.size())) { if (validMembers[i]) { const uint256& proTxHash = members[i]->proTxHash;