Skip to content

Commit

Permalink
Enforce correct port on mainnet for DIP3 MNs (#2576)
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock authored and UdjinM6 committed Dec 21, 2018
1 parent 3f26ed7 commit 03a6865
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/evo/providertx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ static bool CheckService(const uint256& proTxHash, const ProTx& proTx, CValidati
return state.DoS(10, false, REJECT_INVALID, "bad-protx-addr");
}

int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
if (Params().NetworkIDString() == CBaseChainParams::MAIN) {
if (proTx.addr.GetPort() != mainnetDefaultPort) {
return state.DoS(10, false, REJECT_INVALID, "bad-protx-addr-port");
}
} else if (proTx.addr.GetPort() == mainnetDefaultPort) {
return state.DoS(10, false, REJECT_INVALID, "bad-protx-addr-port");
}

if (!proTx.addr.IsIPv4()) {
return state.DoS(10, false, REJECT_INVALID, "bad-protx-addr");
}
Expand Down

0 comments on commit 03a6865

Please sign in to comment.