Skip to content

Commit 8c141f8

Browse files
committed
chore: drop MNAUTH_NODE_VER_VERSION checks
1 parent 5d9435d commit 8c141f8

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/evo/mnauth.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternode
3838
}
3939
auto pk = mn_activeman.GetPubKey();
4040
const CBLSPublicKey pubKey(pk);
41-
uint256 signHash = [&]() {
42-
if (peer.nVersion < MNAUTH_NODE_VER_VERSION || nOurNodeVersion < MNAUTH_NODE_VER_VERSION) {
43-
return ::SerializeHash(std::make_tuple(pubKey, receivedMNAuthChallenge, peer.IsInboundConn()));
44-
} else {
45-
return ::SerializeHash(std::make_tuple(pubKey, receivedMNAuthChallenge, peer.IsInboundConn(), nOurNodeVersion));
46-
}
47-
}();
41+
const uint256 signHash{::SerializeHash(std::make_tuple(pubKey, receivedMNAuthChallenge, peer.IsInboundConn(), nOurNodeVersion))};
4842

4943
mnauth.proRegTxHash = mn_activeman.GetProTxHash();
5044

@@ -97,18 +91,9 @@ MessageProcessingResult CMNAuth::ProcessMessage(CNode& peer, ServiceFlags node_s
9791
return MisbehavingError{10, "missing mnauth masternode"};
9892
}
9993

100-
uint256 signHash;
101-
int nOurNodeVersion{PROTOCOL_VERSION};
102-
if (Params().NetworkIDString() != CBaseChainParams::MAIN && gArgs.IsArgSet("-pushversion")) {
103-
nOurNodeVersion = gArgs.GetIntArg("-pushversion", PROTOCOL_VERSION);
104-
}
10594
const CBLSPublicKey pubKey(dmn->pdmnState->pubKeyOperator.Get());
10695
// See comment in PushMNAUTH (fInbound is negated here as we're on the other side of the connection)
107-
if (peer.nVersion < MNAUTH_NODE_VER_VERSION || nOurNodeVersion < MNAUTH_NODE_VER_VERSION) {
108-
signHash = ::SerializeHash(std::make_tuple(pubKey, peer.GetSentMNAuthChallenge(), !peer.IsInboundConn()));
109-
} else {
110-
signHash = ::SerializeHash(std::make_tuple(pubKey, peer.GetSentMNAuthChallenge(), !peer.IsInboundConn(), peer.nVersion.load()));
111-
}
96+
const uint256 signHash{::SerializeHash(std::make_tuple(pubKey, peer.GetSentMNAuthChallenge(), !peer.IsInboundConn(), peer.nVersion.load()))};
11297
LogPrint(BCLog::NET_NETCONN, "CMNAuth::%s -- constructed signHash for nVersion %d, peer=%d\n", __func__, peer.nVersion, peer.GetId());
11398

11499
if (!mnauth.sig.VerifyInsecure(dmn->pdmnState->pubKeyOperator.Get(), signHash, false)) {

src/version.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ static const int MIN_PEER_PROTO_VERSION = 70221;
2222
//! minimum proto version of masternode to accept in DKGs
2323
static const int MIN_MASTERNODE_PROTO_VERSION = 70238;
2424

25-
//! protocol version is included in MNAUTH starting with this version
26-
static const int MNAUTH_NODE_VER_VERSION = 70218;
27-
2825
//! introduction of QGETDATA/QDATA messages
2926
static const int LLMQ_DATA_MESSAGES_VERSION = 70219;
3027

0 commit comments

Comments
 (0)