uint16_t log: 1; /* 1 if this is a control connection requesting log dump */
uint16_t invitation: 1; /* 1 if this is an invitation */
uint16_t invitation_used: 1; /* 1 if the invitation has been consumed */
+ uint16_t initiator: 1; /* 1 if we initiated this connection */
} connection_status_t;
#include "ecdsa.h"
update_node_udp(mesh, n, NULL);
n->status.broadcast = false;
} else if(n->connection) {
- if(n->connection->outgoing) {
+ if(n->connection->status.initiator) {
send_req_key(mesh, n);
}
}
/* Now that there is a working socket, fill in the rest and register this connection. */
c->status.connecting = true;
+ c->status.initiator = true;
c->name = xstrdup(outgoing->node->name);
c->last_ping_time = mesh->loop.now.tv_sec;