]> git.meshlink.io Git - meshlink/commitdiff
Reset last_connect_try for all nodes when starting the mesh.
authorGuus Sliepen <guus@meshlink.io>
Wed, 22 Jul 2020 18:31:59 +0000 (20:31 +0200)
committerGuus Sliepen <guus@meshlink.io>
Wed, 22 Jul 2020 18:31:59 +0000 (20:31 +0200)
This helps the autoconnect algorithm reconnect faster if the mesh was
stopped and restarted in quick succession.

src/meshlink.c

index 340b6041cfee81d7f7ef641ec55794dae6c1e5f0..07326d56f0642e644628346cbf5a06779e5c830c 100644 (file)
@@ -1713,6 +1713,11 @@ bool meshlink_start(meshlink_handle_t *mesh) {
                return false;
        }
 
+       // Reset node connection timers
+       for splay_each(node_t, n, mesh->nodes) {
+               n->last_connect_try = 0;
+       }
+
        // TODO: open listening sockets first
 
        //Check that a valid name is set