Don't retry outgoing connections if node is connected
authorKirill Isakov <bootctl@gmail.com>
Fri, 20 May 2022 12:41:01 +0000 (18:41 +0600)
committerKirill Isakov <bootctl@gmail.com>
Sun, 29 May 2022 08:43:37 +0000 (14:43 +0600)
src/net_socket.c

index 982bc80..c8aa788 100644 (file)
@@ -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);
        }
 }