From 093a164eeff0e2d7736561e1670a6220ad81efd1 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 27 Sep 2023 11:14:53 +0300 Subject: [PATCH] fix condition in RemoveInvalidVotes --- src/governance/governance.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 0dc6252c720b23..d51f13dc11eecb 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -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) {