From 998ab7cfa8f9f5602ffb6a8ab08eb09dd8c494ed Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 23 Oct 2019 14:07:00 +0300 Subject: [PATCH] p2p: immediately close outgoing connection if handshake fails (fixes a rare connectivity bug) --- src/p2p/net_node.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index ec03b250..71d9706c 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -688,9 +688,11 @@ namespace nodetool LOG_PRINT_CC_L0(con, "Failed to HANDSHAKE with peer " << string_tools::get_ip_string_from_int32(na.ip) << ":" << string_tools::num_to_string_fast(na.port) - /*<< ", try " << try_count*/); + << ", closing connection"); + m_net_server.get_config_object().close(con.m_connection_id); return false; } + if(just_take_peerlist) { m_net_server.get_config_object().close(con.m_connection_id);