mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Directly use deterministicMNManager in CGovernanceManager::GetCurrentVotes
This commit is contained in:
parent
96e0385db8
commit
ae229e2833
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user