Skip to content

Commit

Permalink
fix condition in RemoveInvalidVotes
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Sep 27, 2023
1 parent b46ead7 commit 093a164
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,14 +1501,17 @@ void CGovernanceManager::RemoveInvalidVotes()
changedKeyMNs.emplace_back(oldDmn->collateralOutpoint);
} else if ((p.second.fields & CDeterministicMNStateDiff::Field_pubKeyOperator) && p.second.state.pubKeyOperator != oldDmn->pdmnState->pubKeyOperator) {
changedKeyMNs.emplace_back(oldDmn->collateralOutpoint);
} else if ((p.second.fields & CDeterministicMNStateDiff::Field_nPoSeBanHeight) && p.second.state.IsBanned()) {
changedKeyMNs.emplace_back(oldDmn->collateralOutpoint);
}
}
for (const auto& id : diff.removedMns) {
auto oldDmn = lastMNListForVotingKeys->GetMNByInternalId(id);
changedKeyMNs.emplace_back(oldDmn->collateralOutpoint);
}
curMNList.ForEachMN(false, [&](const auto& dmn) {
if (dmn.pdmnState->IsBanned() && curMNList.GetHeight() - dmn.pdmnState->GetBannedHeight() > Params().GetConsensus().nSuperblockCycle) {
changedKeyMNs.emplace_back(dmn.collateralOutpoint);
}
});

for (const auto& outpoint : changedKeyMNs) {
for (auto& p : mapObjects) {
Expand Down

0 comments on commit 093a164

Please sign in to comment.