Browse Source

bump discovery version

cl-refactor
subtly 10 years ago
parent
commit
a78eee5861
  1. 7
      libp2p/NodeTable.cpp
  2. 2
      libp2p/NodeTable.h

7
libp2p/NodeTable.cpp

@ -463,6 +463,13 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes
case PingNode::type:
{
PingNode in = PingNode::fromBytesConstRef(_from, rlpBytes);
if (in.version != 0x2)
{
if (auto n = nodeEntry(nodeid))
dropNode(n);
return;
}
addNode(nodeid, _from, bi::tcp::endpoint(bi::address::from_string(in.ipAddress), in.port));
Pong p(_from);

2
libp2p/NodeTable.h

@ -315,7 +315,7 @@ struct PingNode: RLPXDatagram<PingNode>
static const uint8_t type = 1;
unsigned version = 1;
unsigned version = 2;
std::string ipAddress;
unsigned port;
unsigned expiration;

Loading…
Cancel
Save