From: CryptoManiac Date: Mon, 22 Feb 2016 15:17:30 +0000 (+0300) Subject: Remove BIP0031_VERSION and MEMPOOL_GD_VERSION. X-Git-Tag: nvc-v0.5.6~48 X-Git-Url: https://git.novaco.in/?a=commitdiff_plain;h=848b99c4b46b2905b0258d08f855857b3898a00f;hp=3833b4e69b7fb9cca574cbead4a765fff0663f16;p=novacoin.git Remove BIP0031_VERSION and MEMPOOL_GD_VERSION. --- diff --git a/src/main.cpp b/src/main.cpp index c8769af..dbd3276 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3720,23 +3720,20 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) else if (strCommand == "ping") { - if (pfrom->nVersion > BIP0031_VERSION) - { - uint64_t nonce = 0; - vRecv >> nonce; - // Echo the message back with the nonce. This allows for two useful features: - // - // 1) A remote node can quickly check if the connection is operational - // 2) Remote nodes can measure the latency of the network thread. If this node - // is overloaded it won't respond to pings quickly and the remote node can - // avoid sending us more work, like chain download requests. - // - // The nonce stops the remote getting confused between different pings: without - // it, if the remote node sends a ping once per second and this node takes 5 - // seconds to respond to each, the 5th ping the remote sends would appear to - // return very quickly. - pfrom->PushMessage("pong", nonce); - } + uint64_t nonce = 0; + vRecv >> nonce; + // Echo the message back with the nonce. This allows for two useful features: + // + // 1) A remote node can quickly check if the connection is operational + // 2) Remote nodes can measure the latency of the network thread. If this node + // is overloaded it won't respond to pings quickly and the remote node can + // avoid sending us more work, like chain download requests. + // + // The nonce stops the remote getting confused between different pings: without + // it, if the remote node sends a ping once per second and this node takes 5 + // seconds to respond to each, the 5th ping the remote sends would appear to + // return very quickly. + pfrom->PushMessage("pong", nonce); } @@ -3920,10 +3917,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // right now. if (pto->nLastSend && GetTime() - pto->nLastSend > nPingInterval && pto->vSend.empty()) { uint64_t nonce = 0; - if (pto->nVersion > BIP0031_VERSION) - pto->PushMessage("ping", nonce); - else - pto->PushMessage("ping"); + pto->PushMessage("ping", nonce); } // Start block sync diff --git a/src/version.h b/src/version.h index e7e3e32..3fa5be8 100644 --- a/src/version.h +++ b/src/version.h @@ -43,12 +43,6 @@ static const int CADDR_TIME_VERSION = 31402; static const int NOBLKS_VERSION_START = 60002; static const int NOBLKS_VERSION_END = 60006; -// BIP 0031, pong message, is enabled for all versions AFTER this one -static const int BIP0031_VERSION = 60000; - -// "mempool" command, enhanced "getdata" behavior starts with this version: -static const int MEMPOOL_GD_VERSION = 60002; - #define DISPLAY_VERSION_MAJOR 0 #define DISPLAY_VERSION_MINOR 5 #define DISPLAY_VERSION_REVISION 5