Skip to content

Commit

Permalink
GH-1101 For outgoing connections do not include the listen address co…
Browse files Browse the repository at this point in the history
…nnection type to avoid the node adopting the mode
  • Loading branch information
heifner committed Jan 22, 2025
1 parent 65bc7d7 commit 3b80641
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,18 +1210,19 @@ namespace eosio {

//---------------------------------------------------------------------------

connection::connection( const string& endpoint, const string& listen_address )
connection::connection( const string& endpoint, const string& this_address )
: peer_addr( endpoint ),
strand( boost::asio::make_strand(my_impl->thread_pool.get_executor()) ),
socket( new tcp::socket( strand ) ),
listen_address( listen_address ),
log_p2p_address( endpoint ),
connection_id( ++my_impl->current_connection_id ),
sync_response_expected_timer( my_impl->thread_pool.get_executor() ),
last_handshake_recv(),
last_handshake_sent(),
p2p_address( endpoint )
{
auto [host, port, type] = net_utils::split_host_port_type(this_address);
listen_address = host + ":" + port; // do not include type in listen_address to avoid peer setting type on connection
set_connection_type( peer_address() );
my_impl->mark_bp_connection(this);
fc_ilog( logger, "created connection - ${c} to ${n}", ("c", connection_id)("n", endpoint) );
Expand Down

0 comments on commit 3b80641

Please sign in to comment.