|
|
@ -131,7 +131,14 @@ void RLPXHandshake::readAck() |
|
|
|
|
|
|
|
void RLPXHandshake::error() |
|
|
|
{ |
|
|
|
clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Failed)"; |
|
|
|
m_idleTimer.cancel(); |
|
|
|
|
|
|
|
auto connected = m_socket->isConnected(); |
|
|
|
if (connected && !m_socket->remoteEndpoint().address().is_unspecified()) |
|
|
|
clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Failed)"; |
|
|
|
else |
|
|
|
clog(NetConnect) << "Handshake Failed (Connection reset by peer)"; |
|
|
|
|
|
|
|
m_socket->close(); |
|
|
|
if (m_io != nullptr) |
|
|
|
delete m_io; |
|
|
@ -140,7 +147,10 @@ void RLPXHandshake::error() |
|
|
|
void RLPXHandshake::transition(boost::system::error_code _ech) |
|
|
|
{ |
|
|
|
if (_ech || m_nextState == Error || m_cancel) |
|
|
|
{ |
|
|
|
clog(NetConnect) << "Handshake Failed (I/O Error:" << _ech.message() << ")"; |
|
|
|
return error(); |
|
|
|
} |
|
|
|
|
|
|
|
auto self(shared_from_this()); |
|
|
|
if (m_nextState == New) |
|
|
@ -265,7 +275,8 @@ void RLPXHandshake::transition(boost::system::error_code _ech) |
|
|
|
{ |
|
|
|
if (!_ec) |
|
|
|
{ |
|
|
|
clog(NetWarn) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; |
|
|
|
if (!m_socket->remoteEndpoint().address().is_unspecified()) |
|
|
|
clog(NetWarn) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; |
|
|
|
cancel(); |
|
|
|
} |
|
|
|
}); |
|
|
|