Use actual remote port for async connection
Replaces usage of node_data.my_port with context.m_remote_port when establishing an async connection, ensuring the correct remote port is used for peer connections.
This commit is contained in:
parent
7f930b0fec
commit
3e2bad36a6
1 changed files with 3 additions and 1 deletions
|
|
@ -1422,10 +1422,12 @@ namespace nodetool
|
|||
return false;
|
||||
|
||||
uint32_t actual_ip = context.m_remote_ip;
|
||||
uint16_t actual_port = context.m_remote_port;
|
||||
if(!m_peerlist.is_ip_allowed(actual_ip))
|
||||
return false;
|
||||
std::string ip = string_tools::get_ip_string_from_int32(actual_ip);
|
||||
std::string port = string_tools::num_to_string_fast(node_data.my_port);
|
||||
// std::string port = string_tools::num_to_string_fast(node_data.my_port);
|
||||
std::string port = string_tools::num_to_string_fast(actual_port);
|
||||
peerid_type pr = node_data.peer_id;
|
||||
bool r = m_net_server.connect_async(ip, port, m_config.m_net_config.ping_connection_timeout, [cb, /*context,*/ ip, port, pr, this](
|
||||
const typename net_server::t_connection_context& ping_context,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue