Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 2d27205

Browse files
committed
Reuse RLPxHandshake ctor
1 parent 2a6f7dd commit 2d27205

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

libp2p/RLPxHandshake.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@ constexpr size_t c_authCipherSizeBytes = 307;
2121
}
2222

2323
RLPXHandshake::RLPXHandshake(Host* _host, std::shared_ptr<RLPXSocket> const& _socket)
24-
: m_host(_host),
25-
m_originated(false),
26-
m_socket(_socket),
27-
m_idleTimer(m_socket->ref().get_io_service())
28-
{
29-
m_logger.add_attribute(
30-
"Context", boost::log::attributes::constant<std::string>(connectionDirectionString()));
31-
m_errorLogger.add_attribute(
32-
"Context", boost::log::attributes::constant<std::string>(connectionDirectionString()));
33-
crypto::Nonce::get().ref().copyTo(m_nonce.ref());
34-
}
24+
: RLPXHandshake(_host, _socket, {})
25+
{}
3526

3627
RLPXHandshake::RLPXHandshake(
3728
Host* _host, std::shared_ptr<RLPXSocket> const& _socket, NodeID _remote)
3829
: m_host(_host),
3930
m_remote(_remote),
40-
m_originated(true),
31+
m_originated(_remote),
4132
m_socket(_socket),
4233
m_idleTimer(m_socket->ref().get_io_service())
4334
{

0 commit comments

Comments
 (0)