Skip to content

Commit

Permalink
fix: do not ask for govvotes of objects that are about to be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Oct 24, 2023
1 parent 6de0c11 commit ce35720
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,8 @@ int CGovernanceManager::RequestGovernanceObjectVotes(Span<CNode*> vNodesCopy, CC

if (mapObjects.empty()) return -2;

for (const auto& objPair : mapObjects) {
uint256 nHash = objPair.first;
for (const auto& [nHash, govobj] : mapObjects) {
if (govobj.IsSetCachedDelete()) continue;
if (mapAskedRecently.count(nHash)) {
auto it = mapAskedRecently[nHash].begin();
while (it != mapAskedRecently[nHash].end()) {
Expand All @@ -1217,7 +1217,7 @@ int CGovernanceManager::RequestGovernanceObjectVotes(Span<CNode*> vNodesCopy, CC
if (mapAskedRecently[nHash].size() >= nPeersPerHashMax) continue;
}

if (objPair.second.GetObjectType() == GovernanceObject::TRIGGER) {
if (govObj.GetObjectType() == GovernanceObject::TRIGGER) {
vTriggerObjHashes.push_back(nHash);
} else {
vOtherObjHashes.push_back(nHash);
Expand Down

0 comments on commit ce35720

Please sign in to comment.