MCPcopy Create free account
hub / github.com/ElementsProject/lightning / find_connecting

Function find_connecting

connectd/connectd.c:148–162  ·  view source on GitHub ↗

~ Most simple search functions start with find_; in this case, search * for an existing attempt to connect the given peer id. */

Source from the content-addressed store, hash-verified

146/*~ Most simple search functions start with find_; in this case, search
147 * for an existing attempt to connect the given peer id. */
148static struct connecting *find_connecting(struct daemon *daemon,
149 const struct node_id *id)
150{
151 struct connecting *i;
152
153 /*~ Note the node_id_eq function: this is generally preferred over
154 * doing a memcmp() manually, as it is both typesafe and can handle
155 * any padding which the C compiler is allowed to insert between
156 * members (unnecessary here, as there's no padding in a `struct
157 * node_id`). */
158 list_for_each(&daemon->connecting, i, list)
159 if (node_id_eq(id, &i->id))
160 return i;
161 return NULL;
162}
163
164/*~ Once we've connected out, we disable the callback which would cause us to
165 * to try the next address. */

Callers 4

connected_out_to_peerFunction · 0.85
peer_connected_inFunction · 0.85
peer_connectedFunction · 0.85
try_connect_peerFunction · 0.85

Calls 1

node_id_eqFunction · 0.85

Tested by

no test coverage detected