diff --git a/src/llmq/dkgsessionmgr.cpp b/src/llmq/dkgsessionmgr.cpp index c4d1dce1f7252..935a4d7df7702 100644 --- a/src/llmq/dkgsessionmgr.cpp +++ b/src/llmq/dkgsessionmgr.cpp @@ -390,7 +390,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, m_dmnman, pQuorumBaseBlockIndex); memberIndexesRet.clear(); @@ -399,6 +398,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;