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.
This commit is contained in:
parent
2ea9c69985
commit
5254255a0a
@ -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 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)
|
// CHECK COLLATERAL IF REQUIRED (HIGH CPU USAGE)
|
||||||
|
|
||||||
if(fCheckCollateral) {
|
if(fCheckCollateral) {
|
||||||
|
@ -158,7 +158,6 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
|||||||
|
|
||||||
if(!AcceptObjectMessage(nHash)) {
|
if(!AcceptObjectMessage(nHash)) {
|
||||||
LogPrintf("MNGOVERNANCEOBJECT -- Received unrequested object: %s\n", strHash);
|
LogPrintf("MNGOVERNANCEOBJECT -- Received unrequested object: %s\n", strHash);
|
||||||
Misbehaving(pfrom->GetId(), 20);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +242,6 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
|||||||
if(!AcceptVoteMessage(nHash)) {
|
if(!AcceptVoteMessage(nHash)) {
|
||||||
LogPrint("gobject", "MNGOVERNANCEOBJECTVOTE -- Received unrequested vote object: %s, hash: %s, peer = %d\n",
|
LogPrint("gobject", "MNGOVERNANCEOBJECTVOTE -- Received unrequested vote object: %s, hash: %s, peer = %d\n",
|
||||||
vote.ToString(), strHash, pfrom->GetId());
|
vote.ToString(), strHash, pfrom->GetId());
|
||||||
//Misbehaving(pfrom->GetId(), 20);
|
|
||||||
return;
|
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);
|
LogPrint("gobject", "CGovernanceManager::Sync -- attempting to sync govobj: %s, peer=%d\n", strHash, pfrom->id);
|
||||||
|
|
||||||
if(!govobj.IsSetCachedValid()) {
|
if(govobj.IsSetCachedDelete()) {
|
||||||
LogPrintf("CGovernanceManager::Sync -- invalid flag cached, not syncing govobj: %s, fCachedValid = %d, peer=%d\n",
|
LogPrintf("CGovernanceManager::Sync -- not syncing deleted govobj: %s, peer=%d\n",
|
||||||
strHash, govobj.IsSetCachedValid(), pfrom->id);
|
strHash, pfrom->id);
|
||||||
continue;
|
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);
|
LogPrint("gobject", "CGovernanceManager::Sync -- attempting to sync govobj: %s, peer=%d\n", strHash, pfrom->id);
|
||||||
|
|
||||||
if(!govobj.IsSetCachedValid()) {
|
if(govobj.IsSetCachedDelete()) {
|
||||||
LogPrintf("CGovernanceManager::Sync -- invalid flag cached, not syncing govobj: %s, fCachedValid = %d, peer=%d\n",
|
LogPrintf("CGovernanceManager::Sync -- not syncing deleted govobj: %s, peer=%d\n",
|
||||||
strHash, govobj.IsSetCachedValid(), pfrom->id);
|
strHash, pfrom->id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user