@@ -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 )) {
0 commit comments