Ensure governance objects are still valid before relaying

This commit is contained in:
Tim Flynn 2016-11-14 21:27:05 -05:00
parent 6deb3a65a3
commit c4c4f1dad7

View File

@ -551,7 +551,10 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp)
CGovernanceObject& govobj = it->second; CGovernanceObject& govobj = it->second;
if(govobj.IsSetCachedValid() && (nProp == uint256() || h == nProp)) { std::string strError;
if(govobj.IsSetCachedValid() &&
(nProp == uint256() || h == nProp) &&
govobj.IsValidLocally(pCurrentBlockIndex, strError, true)) {
// Push the inventory budget proposal message over to the other client // Push the inventory budget proposal message over to the other client
pfrom->PushInventory(CInv(MSG_GOVERNANCE_OBJECT, h)); pfrom->PushInventory(CInv(MSG_GOVERNANCE_OBJECT, h));
++nInvCount; ++nInvCount;