|
@ -217,9 +217,8 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io |
|
|
ps->disconnect(DuplicatePeer); |
|
|
ps->disconnect(DuplicatePeer); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
m_sessions[_id] = ps; |
|
|
|
|
|
} |
|
|
// todo: mutex Session::m_capabilities and move for(:caps) out of mutex.
|
|
|
ps->start(); |
|
|
|
|
|
unsigned o = (unsigned)UserPacket; |
|
|
unsigned o = (unsigned)UserPacket; |
|
|
for (auto const& i: caps) |
|
|
for (auto const& i: caps) |
|
|
if (haveCapability(i)) |
|
|
if (haveCapability(i)) |
|
@ -227,6 +226,10 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io |
|
|
ps->m_capabilities[i] = shared_ptr<Capability>(m_capabilities[i]->newPeerCapability(ps.get(), o)); |
|
|
ps->m_capabilities[i] = shared_ptr<Capability>(m_capabilities[i]->newPeerCapability(ps.get(), o)); |
|
|
o += m_capabilities[i]->messageCount(); |
|
|
o += m_capabilities[i]->messageCount(); |
|
|
} |
|
|
} |
|
|
|
|
|
ps->start(); |
|
|
|
|
|
m_sessions[_id] = ps; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
clog(NetNote) << "p2p.host.peer.register" << _id.abridged(); |
|
|
clog(NetNote) << "p2p.host.peer.register" << _id.abridged(); |
|
|
StructuredLogger::p2pConnected(_id.abridged(), ps->m_peer->peerEndpoint(), ps->m_peer->m_lastConnected, clientVersion, peerCount()); |
|
|
StructuredLogger::p2pConnected(_id.abridged(), ps->m_peer->peerEndpoint(), ps->m_peer->m_lastConnected, clientVersion, peerCount()); |
|
|
} |
|
|
} |
|
|