Skip to content

Commit

Permalink
GH-525 Remove call to update_endpoints which I thought I already remo…
Browse files Browse the repository at this point in the history
…ved. Add additional debug statements.
  • Loading branch information
heifner committed Oct 2, 2024
1 parent 4cf8f50 commit c8dca0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ namespace eosio {
}

void connection::update_endpoints(const tcp::endpoint& endpoint) {
peer_dlog(this, "update endpoints");
boost::system::error_code ec;
boost::system::error_code ec2;
auto rep = endpoint == tcp::endpoint() ? socket->remote_endpoint(ec) : endpoint;
Expand All @@ -1325,6 +1326,7 @@ namespace eosio {
fc_dlog( logger, "unable to retrieve remote endpoint for local ${address}:${port}", ("address", local_endpoint_ip)("port", local_endpoint_port));
remote_endpoint_ip_array = boost::asio::ip::address_v6().to_bytes();
}
peer_dlog(this, "done update endpoints");
}

// called from connection strand
Expand Down Expand Up @@ -2822,7 +2824,6 @@ namespace eosio {
boost::asio::bind_executor( strand,
[c = shared_from_this(), socket=socket]( const boost::system::error_code& err, const tcp::endpoint& endpoint ) {
if( !err && socket->is_open() && socket == c->socket ) {
c->update_endpoints(endpoint);
if( c->start_session() ) {
c->send_handshake();
c->send_time();
Expand Down Expand Up @@ -4687,11 +4688,14 @@ namespace eosio {
}
}

fc_dlog(logger, "connecting to ${h}:${p}", ("h", host)("p", port));
strand.post([c, host, port]() {
auto resolver = std::make_shared<tcp::resolver>( c->strand.context() );
fc_dlog(logger, "resolve ${h}:${p}", ("h", host)("p", port));
resolver->async_resolve(host, port,
[resolver, c, host, port]
( const boost::system::error_code& err, const tcp::resolver::results_type& results ) {
fc_dlog(logger, "resolved ${h}:${p}", ("h", host)("p", port));
c->set_heartbeat_timeout( my_impl->connections.get_heartbeat_timeout() );
if( !err ) {
c->connect( results );
Expand Down

0 comments on commit c8dca0e

Please sign in to comment.