]> git.meshlink.io Git - meshlink/commitdiff
Check for key later because maybe we have to generate it
authorSaverio Proto <zioproto@gmail.com>
Tue, 17 Jun 2014 17:19:21 +0000 (19:19 +0200)
committerSaverio Proto <zioproto@gmail.com>
Tue, 17 Jun 2014 17:19:21 +0000 (19:19 +0200)
src/meshlink.c

index e6ea203fbe996748e7e309ccf5fe69f4767bc8e6..af248044650af88ef395f27e6542f287bf3acb02 100644 (file)
@@ -740,8 +740,6 @@ meshlink_handle_t *meshlink_open(const char *confbase, const char *name) {
        if (usingname) mesh->name = xstrdup(name);
        mesh->self = new_node();
        mesh->self->connection = new_connection();
-       if(!read_ecdsa_private_key(mesh))
-               return false;
        init_nodes(mesh);
        pthread_mutex_init ( &(mesh->outpacketqueue_mutex), NULL);
        pthread_mutex_init ( &(mesh->nodes_mutex), NULL);
@@ -779,6 +777,8 @@ meshlink_handle_t *meshlink_open(const char *confbase, const char *name) {
        WSAStartup(MAKEWORD(2, 2), &wsa_state);
 #endif
 
+       if(!read_ecdsa_private_key(mesh))
+               return false;
 
        return mesh;
 }