Don't penalize nodes during orphan processing (#1181)
This commit is contained in:
parent
c3e5757c25
commit
8c12ab2b47
@ -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<vote_time_pair_t> 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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user