Skip to content

Commit

Permalink
Directly use deterministicMNManager in CGovernanceManager::GetCurrent…
Browse files Browse the repository at this point in the history
…Votes
  • Loading branch information
codablock committed Dec 31, 2018
1 parent 96e0385 commit ae229e2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,17 @@ std::vector<CGovernanceVote> CGovernanceManager::GetCurrentVotes(const uint256&
if (it == mapObjects.end()) return vecResult;
const CGovernanceObject& govobj = it->second;

CMasternode mn;
std::map<COutPoint, CMasternode> mapMasternodes;
auto mnList = deterministicMNManager->GetListAtChainTip();
std::map<COutPoint, CDeterministicMNCPtr> mapMasternodes;
if (mnCollateralOutpointFilter.IsNull()) {
mapMasternodes = mnodeman.GetFullMasternodeMap();
} else if (mnodeman.Get(mnCollateralOutpointFilter, mn)) {
mapMasternodes[mnCollateralOutpointFilter] = mn;
mnList.ForEachMN(true, [&](const CDeterministicMNCPtr& dmn) {
mapMasternodes.emplace(dmn->collateralOutpoint, dmn);
});
} else {
auto dmn = mnList.GetValidMNByCollateral(mnCollateralOutpointFilter);
if (dmn) {
mapMasternodes.emplace(dmn->collateralOutpoint, dmn);
}
}

// Loop thru each MN collateral outpoint and get the votes for the `nParentHash` governance object
Expand Down

0 comments on commit ae229e2

Please sign in to comment.