From 60931709905a582d60ce23792b907b827ad2f6ad Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 22 Mar 2015 20:18:08 +0100 Subject: [PATCH] consistent and explicit use of constant for devp2p protocol version --- libp2p/Host.cpp | 4 ++-- libp2p/NodeTable.cpp | 2 +- libp2p/NodeTable.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 30cadb515..13ea87ba6 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -709,7 +709,7 @@ bytes Host::saveNetwork() const } RLPStream ret(3); - ret << c_protocolVersion << m_alias.secret(); + ret << dev::p2p::c_protocolVersion << m_alias.secret(); ret.appendList(count).appendRaw(network.out(), count); return ret.out(); } @@ -722,7 +722,7 @@ void Host::restoreNetwork(bytesConstRef _b) RecursiveGuard l(x_sessions); RLP r(_b); - if (r.itemCount() > 0 && r[0].isInt() && r[0].toInt() == c_protocolVersion) + if (r.itemCount() > 0 && r[0].isInt() && r[0].toInt() == dev::p2p::c_protocolVersion) { // r[0] = version // r[1] = key diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index 1f024a911..0d6dda214 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -477,7 +477,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes case PingNode::type: { PingNode in = PingNode::fromBytesConstRef(_from, rlpBytes); - if (in.version != c_protocolVersion) + if (in.version != dev::p2p::c_protocolVersion) { if (auto n = nodeEntry(nodeid)) dropNode(n); diff --git a/libp2p/NodeTable.h b/libp2p/NodeTable.h index 10ba232c3..58fa722c1 100644 --- a/libp2p/NodeTable.h +++ b/libp2p/NodeTable.h @@ -316,7 +316,7 @@ struct PingNode: RLPXDatagram static const uint8_t type = 1; - unsigned version = c_protocolVersion; + unsigned version = dev::p2p::c_protocolVersion; std::string ipAddress; unsigned port; unsigned expiration;