File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -515,12 +515,17 @@ std::vector<CGovernanceVote> CGovernanceManager::GetCurrentVotes(const uint256&
515
515
if (it == mapObjects.end ()) return vecResult;
516
516
const CGovernanceObject& govobj = it->second ;
517
517
518
- CMasternode mn ;
519
- std::map<COutPoint, CMasternode > mapMasternodes;
518
+ auto mnList = deterministicMNManager-> GetListAtChainTip () ;
519
+ std::map<COutPoint, CDeterministicMNCPtr > mapMasternodes;
520
520
if (mnCollateralOutpointFilter.IsNull ()) {
521
- mapMasternodes = mnodeman.GetFullMasternodeMap ();
522
- } else if (mnodeman.Get (mnCollateralOutpointFilter, mn)) {
523
- mapMasternodes[mnCollateralOutpointFilter] = mn;
521
+ mnList.ForEachMN (true , [&](const CDeterministicMNCPtr& dmn) {
522
+ mapMasternodes.emplace (dmn->collateralOutpoint , dmn);
523
+ });
524
+ } else {
525
+ auto dmn = mnList.GetValidMNByCollateral (mnCollateralOutpointFilter);
526
+ if (dmn) {
527
+ mapMasternodes.emplace (dmn->collateralOutpoint , dmn);
528
+ }
524
529
}
525
530
526
531
// Loop thru each MN collateral outpoint and get the votes for the `nParentHash` governance object
You can’t perform that action at this time.
0 commit comments