diff --git a/src/main.cpp b/src/main.cpp index bfcd3c538..475c1546b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,7 +106,7 @@ size_t nCoinCacheUsage = 5000 * 300; uint64_t nPruneTarget = 0; // If the tip is older than this (in seconds), the node is considered to be in initial block download. int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; -bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; +const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; int32_t nFirstHalvingHeight = 340000; unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA; @@ -6886,7 +6886,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); return true; } - auto p2pdebug = GetArg("-p2pdebug",0); + const bool p2pdebug = GetArg("-p2pdebug",0); if(p2pdebug) fprintf(stderr,"%s: netmsg: %s from %s\n", __func__, strCommand.c_str(), pfrom->addr.ToString().c_str() ); @@ -6913,7 +6913,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, CAddress addrFrom; uint64_t nNonce = 1; int nVersion; // use temporary for version, don't set version number until validated as connected - int minVersion = MIN_PEER_PROTO_VERSION; + const int minVersion = ishush3 ? MIN_HUSH_PEER_PROTO_VERSION : MIN_PEER_PROTO_VERSION; vRecv >> nVersion >> pfrom->nServices >> nTime >> addrMe; if (nVersion == 10300) nVersion = 300; diff --git a/src/version.h b/src/version.h index 74a686bd1..d4641ec5a 100644 --- a/src/version.h +++ b/src/version.h @@ -26,8 +26,13 @@ static const int PROTOCOL_VERSION = 1987426; static const int INIT_PROTO_VERSION = 209; //! In this version, 'getheaders' was introduced. static const int GETHEADERS_VERSION = 31800; -//! disconnect from peers older than this proto version + +//! disconnect from peers older than this proto version (HUSH mainnet) +static const int MIN_HUSH_PEER_PROTO_VERSION = 1987426; + +//! disconnect from peers older than this proto version (HACs) static const int MIN_PEER_PROTO_VERSION = 1987420; + //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this static const int CADDR_TIME_VERSION = 31402;