Permalink
Browse files

Split MIN_PROTO_VERSION

  • Loading branch information...
Tranz5 committed Jul 22, 2014
1 parent 3f746d5 commit 4ce4e0357d9250e61decc8f9797b0d5000dfc262
Showing with 9 additions and 7 deletions.
  1. +2 −3 src/main.cpp
  2. +2 −2 src/net.h
  3. +5 −2 src/version.h
View
@@ -3081,10 +3081,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CAddress addrFrom;
uint64 nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
if (pfrom->nVersion < MIN_PROTO_VERSION)
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
{
// Since February 20, 2012, the protocol is initiated at version 209,
// and earlier versions are no longer supported
// disconnect from peers older than this proto version
printf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
View
@@ -260,11 +260,11 @@ class CNode
CCriticalSection cs_inventory;
std::multimap<int64, CInv> mapAskFor;
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, MIN_PROTO_VERSION)
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION)
{
nServices = 0;
hSocket = hSocketIn;
nRecvVersion = MIN_PROTO_VERSION;
nRecvVersion = INIT_PROTO_VERSION;
nLastSend = 0;
nLastRecv = 0;
nLastSendEmpty = GetTime();
View
@@ -27,8 +27,11 @@ static const int DATABASE_VERSION = 70501;
// network protocol versioning
static const int PROTOCOL_VERSION = 70005;
// earlier versions not supported as of Feb 2012, and are disconnected
static const int MIN_PROTO_VERSION = 209;
// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
// disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 209;
// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this

0 comments on commit 4ce4e03

Please sign in to comment.