From 5254255a0a834b54a0732f09e8e169391f1a9b83 Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Wed, 18 Jan 2017 10:24:04 -0500 Subject: [PATCH] Voting related syncing changes (#1269) * Remove vote count check from IsValidLocally * Do not check voted validity flag when syncing * Do not send objects marked for deletion during syncing * Remove node penalty for unrequested objects. --- src/governance-object.cpp | 5 ----- src/governance.cpp | 14 ++++++-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/governance-object.cpp b/src/governance-object.cpp index 410edbdbe..c14eaa79b 100644 --- a/src/governance-object.cpp +++ b/src/governance-object.cpp @@ -439,11 +439,6 @@ bool CGovernanceObject::IsValidLocally(std::string& strError, bool& fMissingMast // IF ABSOLUTE NO COUNT (NO-YES VALID VOTES) IS MORE THAN 10% OF THE NETWORK MASTERNODES, OBJ IS INVALID - if(GetAbsoluteNoCount(VOTE_SIGNAL_VALID) > mnodeman.CountEnabled(MIN_GOVERNANCE_PEER_PROTO_VERSION)/10) { - strError = "Voted invalid"; - return false; - } - // CHECK COLLATERAL IF REQUIRED (HIGH CPU USAGE) if(fCheckCollateral) { diff --git a/src/governance.cpp b/src/governance.cpp index 88a4b0724..1474346fc 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -158,7 +158,6 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C if(!AcceptObjectMessage(nHash)) { LogPrintf("MNGOVERNANCEOBJECT -- Received unrequested object: %s\n", strHash); - Misbehaving(pfrom->GetId(), 20); return; } @@ -243,7 +242,6 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C if(!AcceptVoteMessage(nHash)) { LogPrint("gobject", "MNGOVERNANCEOBJECTVOTE -- Received unrequested vote object: %s, hash: %s, peer = %d\n", vote.ToString(), strHash, pfrom->GetId()); - //Misbehaving(pfrom->GetId(), 20); return; } @@ -672,9 +670,9 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp) LogPrint("gobject", "CGovernanceManager::Sync -- attempting to sync govobj: %s, peer=%d\n", strHash, pfrom->id); - if(!govobj.IsSetCachedValid()) { - LogPrintf("CGovernanceManager::Sync -- invalid flag cached, not syncing govobj: %s, fCachedValid = %d, peer=%d\n", - strHash, govobj.IsSetCachedValid(), pfrom->id); + if(govobj.IsSetCachedDelete()) { + LogPrintf("CGovernanceManager::Sync -- not syncing deleted govobj: %s, peer=%d\n", + strHash, pfrom->id); continue; } @@ -695,9 +693,9 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp) LogPrint("gobject", "CGovernanceManager::Sync -- attempting to sync govobj: %s, peer=%d\n", strHash, pfrom->id); - if(!govobj.IsSetCachedValid()) { - LogPrintf("CGovernanceManager::Sync -- invalid flag cached, not syncing govobj: %s, fCachedValid = %d, peer=%d\n", - strHash, govobj.IsSetCachedValid(), pfrom->id); + if(govobj.IsSetCachedDelete()) { + LogPrintf("CGovernanceManager::Sync -- not syncing deleted govobj: %s, peer=%d\n", + strHash, pfrom->id); return; }