diff --git a/src/net.c b/src/net.c
index cc01c75b..e436af39 100644
--- a/src/net.c
+++ b/src/net.c
@@ -104,7 +104,6 @@ void terminate_connection(connection_t *c, bool report) {
 		c->edge = NULL;
 
 		/* Run MST and SSSP algorithms */
-
 		graph();
 
 		/* If the node is not reachable anymore but we remember it had an edge to us, clean it up */
@@ -253,7 +252,7 @@ static void periodic_handler(void *data) {
 				if(i++ != r)
 					continue;
 
-				if(!c->outgoing || !c->node || c->node->edge_tree->count < 2)
+				if(!c->outgoing || c->outgoing->keep_it || !c->node || c->node->edge_tree->count < 2)
 					break;
 
 				logger(DEBUG_CONNECTIONS, LOG_INFO, "Autodisconnecting from %s", c->name);
diff --git a/src/net.h b/src/net.h
index 98809f4e..c892d9e2 100644
--- a/src/net.h
+++ b/src/net.h
@@ -122,6 +122,7 @@ typedef struct listen_socket_t {
 
 typedef struct outgoing_t {
 	char *name;
+	bool keep_it;
 	int timeout;
 	splay_tree_t *config_tree;
 	struct config_t *cfg;