diff --git a/src/governance-object.cpp b/src/governance-object.cpp index 0b9cbe0878..f9763a1348 100644 --- a/src/governance-object.cpp +++ b/src/governance-object.cpp @@ -498,14 +498,6 @@ bool CGovernanceObject::IsValidLocally(std::string& strError, bool& fMissingMast strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint; return false; } - if (!mnList.IsMNValid(dmn)) { - if (mnList.IsMNPoSeBanned(dmn)) { - strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint; - } else { - strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint; - } - return false; - } // Check that we have a valid MN signature if (!CheckSignature(dmn->pdmnState->pubKeyOperator)) { diff --git a/src/governance-object.h b/src/governance-object.h index 87a24dd76c..8c9419558e 100644 --- a/src/governance-object.h +++ b/src/governance-object.h @@ -25,6 +25,7 @@ class CGovernanceVote; static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70213; static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206; +static const int GOVERNANCE_POSE_BANNED_VOTES_VERSION = 70215; static const double GOVERNANCE_FILTER_FP_RATE = 0.001; diff --git a/src/governance-vote.cpp b/src/governance-vote.cpp index deea595def..6a0509432d 100644 --- a/src/governance-vote.cpp +++ b/src/governance-vote.cpp @@ -120,8 +120,21 @@ void CGovernanceVote::Relay(CConnman& connman) const return; } + auto mnList = deterministicMNManager->GetListAtChainTip(); + auto dmn = mnList.GetMNByCollateral(masternodeOutpoint); + if (!dmn) { + return; + } + + // When this vote is from non-valid (PoSe banned) MN, we should only announce it to v0.14.0.1 nodes as older nodes + // will ban us otherwise. + int minVersion = MIN_GOVERNANCE_PEER_PROTO_VERSION; + if (!mnList.IsMNValid(dmn)) { + minVersion = GOVERNANCE_POSE_BANNED_VOTES_VERSION; + } + CInv inv(MSG_GOVERNANCE_OBJECT_VOTE, GetHash()); - connman.RelayInv(inv, MIN_GOVERNANCE_PEER_PROTO_VERSION); + connman.RelayInv(inv, minVersion); } void CGovernanceVote::UpdateHash() const @@ -258,7 +271,7 @@ bool CGovernanceVote::IsValid(bool useVotingKey) const return false; } - auto dmn = deterministicMNManager->GetListAtChainTip().GetValidMNByCollateral(masternodeOutpoint); + auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByCollateral(masternodeOutpoint); if (!dmn) { LogPrint("gobject", "CGovernanceVote::IsValid -- Unknown Masternode - %s\n", masternodeOutpoint.ToStringShort()); return false; diff --git a/src/version.h b/src/version.h index 680c2a070d..148cfd2e36 100644 --- a/src/version.h +++ b/src/version.h @@ -11,7 +11,7 @@ */ -static const int PROTOCOL_VERSION = 70214; +static const int PROTOCOL_VERSION = 70215; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209;