Sending message via nano::channel::send rather than directly via send_buffer.
This commit is contained in:
parent
7b7a105867
commit
abdfe15865
1 changed files with 1 additions and 2 deletions
|
|
@ -670,12 +670,11 @@ void nano::transport::tcp_channels::start_tcp_receive_node_id (std::shared_ptr<n
|
||||||
channel_a->set_last_packet_received (std::chrono::steady_clock::now ());
|
channel_a->set_last_packet_received (std::chrono::steady_clock::now ());
|
||||||
boost::optional<std::pair<nano::account, nano::signature>> response (std::make_pair (node_l->node_id.pub, nano::sign_message (node_l->node_id.prv, node_l->node_id.pub, *message.query)));
|
boost::optional<std::pair<nano::account, nano::signature>> response (std::make_pair (node_l->node_id.pub, nano::sign_message (node_l->node_id.prv, node_l->node_id.pub, *message.query)));
|
||||||
nano::node_id_handshake response_message (boost::none, response);
|
nano::node_id_handshake response_message (boost::none, response);
|
||||||
auto bytes = response_message.to_shared_const_buffer ();
|
|
||||||
if (node_l->config.logging.network_node_id_handshake_logging ())
|
if (node_l->config.logging.network_node_id_handshake_logging ())
|
||||||
{
|
{
|
||||||
node_l->logger.try_log (boost::str (boost::format ("Node ID handshake response sent with node ID %1% to %2%: query %3%") % node_l->node_id.pub.to_node_id () % endpoint_a % (*message.query).to_string ()));
|
node_l->logger.try_log (boost::str (boost::format ("Node ID handshake response sent with node ID %1% to %2%: query %3%") % node_l->node_id.pub.to_node_id () % endpoint_a % (*message.query).to_string ()));
|
||||||
}
|
}
|
||||||
channel_a->send_buffer (bytes, [node_w, channel_a, endpoint_a, callback_a, cleanup_and_udp_fallback] (boost::system::error_code const & ec, size_t size_a) {
|
channel_a->send (response_message, [node_w, channel_a, endpoint_a, callback_a, cleanup_and_udp_fallback] (boost::system::error_code const & ec, size_t size_a) {
|
||||||
if (auto node_l = node_w.lock ())
|
if (auto node_l = node_w.lock ())
|
||||||
{
|
{
|
||||||
if (!ec && channel_a)
|
if (!ec && channel_a)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue