Don't penalize nodes during orphan processing (#1181)

This commit is contained in:
Tim Flynn 2016-12-02 07:53:18 -05:00 committed by UdjinM6
parent c3e5757c25
commit 8c12ab2b47
2 changed files with 4 additions and 9 deletions

View File

@ -206,7 +206,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
// WE MIGHT HAVE PENDING/ORPHAN VOTES FOR THIS OBJECT // WE MIGHT HAVE PENDING/ORPHAN VOTES FOR THIS OBJECT
CGovernanceException exception; CGovernanceException exception;
CheckOrphanVotes(pfrom, govobj, exception); CheckOrphanVotes(govobj, exception);
} }
// A NEW GOVERNANCE OBJECT VOTE HAS ARRIVED // 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(); uint256 nHash = govobj.GetHash();
std::vector<vote_time_pair_t> vecVotePairs; std::vector<vote_time_pair_t> vecVotePairs;
@ -262,15 +262,10 @@ void CGovernanceManager::CheckOrphanVotes(CNode* pfrom, CGovernanceObject& govob
if(pairVote.second < nNow) { if(pairVote.second < nNow) {
fRemove = true; fRemove = true;
} }
else if(govobj.ProcessVote(pfrom, vote, exception)) { else if(govobj.ProcessVote(NULL, vote, exception)) {
vote.Relay(); vote.Relay();
fRemove = true; fRemove = true;
} }
else {
if((exception.GetNodePenalty() != 0) && masternodeSync.IsSynced()) {
Misbehaving(pfrom->GetId(), exception.GetNodePenalty());
}
}
if(fRemove) { if(fRemove) {
mapOrphanVotes.Erase(nHash, pairVote); mapOrphanVotes.Erase(nHash, pairVote);
} }

View File

@ -275,7 +275,7 @@ private:
static bool AcceptMessage(const uint256& nHash, hash_s_t& setHash); 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(); void RebuildIndexes();