|
|
@ -208,7 +208,7 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io |
|
|
|
|
|
|
|
// create session so disconnects are managed
|
|
|
|
auto ps = make_shared<Session>(this, _io, p, PeerSessionInfo({_id, clientVersion, _endpoint.address().to_string(), listenPort, chrono::steady_clock::duration(), _rlp[2].toSet<CapDesc>(), 0, map<string, string>()})); |
|
|
|
if (protocolVersion != dev::p2p::c_protocolVersion) |
|
|
|
if (protocolVersion < dev::p2p::c_protocolVersion) |
|
|
|
{ |
|
|
|
ps->disconnect(IncompatibleProtocol); |
|
|
|
return; |
|
|
@ -759,7 +759,7 @@ void Host::restoreNetwork(bytesConstRef _b) |
|
|
|
// todo: ipv6, bi::address_v6(i[0].toArray<byte, 16>()
|
|
|
|
Node n((NodeId)i[2], NodeIPEndpoint(bi::address_v4(i[0].toArray<byte, 4>()), i[1].toInt<uint16_t>(), i[1].toInt<uint16_t>())); |
|
|
|
if (i.itemCount() == 3 && n.endpoint.isAllowed()) |
|
|
|
m_nodeTable->addNode(n); |
|
|
|
m_nodeTable->addNode(n, NodeTable::NodeRelation::Known); |
|
|
|
else if (i.itemCount() == 10) |
|
|
|
{ |
|
|
|
n.required = i[3].toInt<bool>(); |
|
|
@ -776,7 +776,7 @@ void Host::restoreNetwork(bytesConstRef _b) |
|
|
|
if (p->required) |
|
|
|
requirePeer(p->id, n.endpoint); |
|
|
|
else |
|
|
|
m_nodeTable->addNode(*p.get()); |
|
|
|
m_nodeTable->addNode(*p.get(), NodeTable::NodeRelation::Known); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|