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
11 changes: 9 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down