From 84b24109000ce66125038793df313205e5836b83 Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Fri, 20 May 2022 18:41:01 +0600 Subject: [PATCH] Don't retry outgoing connections if node is connected --- src/net_socket.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/net_socket.c b/src/net_socket.c index 982bc800..c8aa7882 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -671,17 +671,10 @@ void setup_outgoing_connection(outgoing_t *outgoing, bool verbose) { n->address_cache = open_address_cache(n); } - if(!n->connection) { - do_outgoing_connection(outgoing); - return; - } - - logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name); - - if(n->connection->outgoing) { - list_delete(&outgoing_list, outgoing); + if(n->connection) { + logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name); } else { - n->connection->outgoing = outgoing; + do_outgoing_connection(outgoing); } } -- 2.20.1