X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_key.c;h=64a0ce8faff20b743ed81740d925fe613dd04793;hb=6354733cc5044c5226c430d97262c06ab4cd0d5e;hp=c1ffe322aa06ce24046494923ad4e8cdece13a73;hpb=9e588a7b6cb4fff70f223bab1ba3120acff1f18b;p=meshlink diff --git a/src/protocol_key.c b/src/protocol_key.c index c1ffe322..64a0ce8f 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -133,6 +133,17 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * logger(mesh, MESHLINK_INFO, "Learned ECDSA public key from %s", from->name); from->status.dirty = true; + + /* If we are trying to form an outgoing connection to this node, retry immediately */ + for list_each(outgoing_t, outgoing, mesh->outgoings) { + if(outgoing->node == from && outgoing->ev.cb) { + outgoing->timeout = 0; + timeout_set(&mesh->loop, &outgoing->ev, &(struct timeval) { + 0, 0 + }); + } + } + return true; }