From 09dfacd0eb049cd4ef9ecb491d58c566634b200b Mon Sep 17 00:00:00 2001 From: miketout Date: Thu, 20 Sep 2018 14:07:16 -0700 Subject: [PATCH] Don't reject based on erroneous version --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1c0c19bad..e31456e4b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6298,6 +6298,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, uint64_t nNonce = 1; int nVersion; // use temporary for version, don't set version number until validated as connected vRecv >> nVersion >> pfrom->nServices >> nTime >> addrMe; + if (nVersion == 10300) + nVersion = 300; + if (nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version @@ -6311,7 +6314,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Reject incoming connections from nodes that don't know about the current epoch const Consensus::Params& params = Params().GetConsensus(); auto currentEpoch = CurrentEpoch(GetHeight(), params); - if (pfrom->nVersion < params.vUpgrades[currentEpoch].nProtocolVersion) + if (nVersion < params.vUpgrades[currentEpoch].nProtocolVersion) { LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, nVersion); pfrom->PushMessage("reject", strCommand, REJECT_OBSOLETE, @@ -6321,8 +6324,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return false; } - if (nVersion == 10300) - nVersion = 300; if (!vRecv.empty()) vRecv >> addrFrom >> nNonce; if (!vRecv.empty()) {