Skip to content

Commit c3f29c1

Browse files
committed
Only announce votes from banned MNs to >= 70215 proto version nodes
1 parent 02656ec commit c3f29c1

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/governance/governance-object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CGovernanceVote;
2525

2626
static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70213;
2727
static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206;
28+
static const int GOVERNANCE_POSE_BANNED_VOTES_VERSION = 70215;
2829

2930
static const double GOVERNANCE_FILTER_FP_RATE = 0.001;
3031

src/governance/governance-vote.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,21 @@ void CGovernanceVote::Relay(CConnman& connman) const
120120
return;
121121
}
122122

123+
auto mnList = deterministicMNManager->GetListAtChainTip();
124+
auto dmn = mnList.GetMNByCollateral(masternodeOutpoint);
125+
if (!dmn) {
126+
return;
127+
}
128+
129+
// When this vote is from non-valid (PoSe banned) MN, we should only announce it to v0.14.0.1 nodes as older nodes
130+
// will ban us otherwise.
131+
int minVersion = MIN_GOVERNANCE_PEER_PROTO_VERSION;
132+
if (!mnList.IsMNValid(dmn)) {
133+
minVersion = GOVERNANCE_POSE_BANNED_VOTES_VERSION;
134+
}
135+
123136
CInv inv(MSG_GOVERNANCE_OBJECT_VOTE, GetHash());
124-
connman.RelayInv(inv, MIN_GOVERNANCE_PEER_PROTO_VERSION);
137+
connman.RelayInv(inv, minVersion);
125138
}
126139

127140
void CGovernanceVote::UpdateHash() const

0 commit comments

Comments
 (0)