diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 548a4ad1bab6..999485156c6a 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -581,7 +581,9 @@ void CGovernanceManager::SyncSingleObjVotes(CNode& peer, const uint256& nProp, c LogPrint(BCLog::GOBJECT, "CGovernanceManager::%s -- syncing single object to peer=%d, nProp = %s\n", __func__, peer.GetId(), nProp.ToString()); - LOCK(cs); + // TODO: drop cs_main here when v19 activation is buried + // and CGovernanceVote::CheckSignature no longer needs to use ::ChainActive() + LOCK2(cs_main, cs); // single valid object and its valid votes auto it = mapObjects.find(nProp); @@ -775,6 +777,9 @@ bool CGovernanceManager::MasternodeRateCheck(const CGovernanceObject& govobj, bo bool CGovernanceManager::ProcessVote(CNode* pfrom, const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman) { + // TODO: drop cs_main here when v19 activation is buried + // and CGovernanceVote::CheckSignature no longer needs to use ::ChainActive() + LOCK(cs_main); ENTER_CRITICAL_SECTION(cs) uint256 nHashVote = vote.GetHash(); uint256 nHashGovobj = vote.GetParentHash(); @@ -1238,7 +1243,9 @@ void CGovernanceManager::RemoveInvalidVotes() return; } - LOCK(cs); + // TODO: drop cs_main here when v19 activation is buried + // and CGovernanceVote::CheckSignature no longer needs to use ::ChainActive() + LOCK2(cs_main, cs); auto curMNList = deterministicMNManager->GetListAtChainTip(); auto diff = lastMNListForVotingKeys->BuildDiff(curMNList);