Browse Source

Move to obscure's Hello format.

cl-refactor
Gav Wood 11 years ago
parent
commit
e2e5b41349
  1. 10
      libethereum/PeerNetwork.cpp

10
libethereum/PeerNetwork.cpp

@ -42,14 +42,15 @@ PeerSession::~PeerSession()
bool PeerSession::interpret(RLP const& _r)
{
cout << ">>> " << _r << endl;
switch (_r[0].toInt<unsigned>())
{
case Hello:
{
cout << std::setw(2) << m_socket.native_handle() << " | Hello" << endl;
m_protocolVersion = _r[1].toInt<uint>();
m_networkId = _r[2].toInt<uint>();
auto clientVersion = _r[3].toString();
m_protocolVersion = _r[1][0].toInt<uint>();
m_networkId = _r[1][1].toInt<uint>();
auto clientVersion = _r[1][2].toString();
if (m_protocolVersion != 0 || m_networkId != m_reqNetworkId)
{
disconnect();
@ -325,7 +326,8 @@ void PeerSession::start()
{
RLPStream s;
prep(s);
s.appendList(4) << (uint)Hello << (uint)0 << (uint)0 << m_server->m_clientVersion;
s.appendList(2) << (uint)Hello;
s.appendList(3) << (uint)0 << (uint)0 << m_server->m_clientVersion;
sealAndSend(s);
ping();

Loading…
Cancel
Save