From 8c12ab2b470749a67ba4351a06368cf77a097b39 Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Fri, 2 Dec 2016 07:53:18 -0500 Subject: [PATCH] Don't penalize nodes during orphan processing (#1181) --- src/governance.cpp | 11 +++-------- src/governance.h | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/governance.cpp b/src/governance.cpp index ebc5ba06c..7379435e3 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -206,7 +206,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C // WE MIGHT HAVE PENDING/ORPHAN VOTES FOR THIS OBJECT CGovernanceException exception; - CheckOrphanVotes(pfrom, govobj, exception); + CheckOrphanVotes(govobj, exception); } // A NEW GOVERNANCE OBJECT VOTE HAS ARRIVED @@ -247,7 +247,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C } } -void CGovernanceManager::CheckOrphanVotes(CNode* pfrom, CGovernanceObject& govobj, CGovernanceException& exception) +void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, CGovernanceException& exception) { uint256 nHash = govobj.GetHash(); std::vector vecVotePairs; @@ -262,15 +262,10 @@ void CGovernanceManager::CheckOrphanVotes(CNode* pfrom, CGovernanceObject& govob if(pairVote.second < nNow) { fRemove = true; } - else if(govobj.ProcessVote(pfrom, vote, exception)) { + else if(govobj.ProcessVote(NULL, vote, exception)) { vote.Relay(); fRemove = true; } - else { - if((exception.GetNodePenalty() != 0) && masternodeSync.IsSynced()) { - Misbehaving(pfrom->GetId(), exception.GetNodePenalty()); - } - } if(fRemove) { mapOrphanVotes.Erase(nHash, pairVote); } diff --git a/src/governance.h b/src/governance.h index c6efc1202..5fabe2c80 100644 --- a/src/governance.h +++ b/src/governance.h @@ -275,7 +275,7 @@ private: static bool AcceptMessage(const uint256& nHash, hash_s_t& setHash); - void CheckOrphanVotes(CNode* pfrom, CGovernanceObject& govobj, CGovernanceException& exception); + void CheckOrphanVotes(CGovernanceObject& govobj, CGovernanceException& exception); void RebuildIndexes();