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

Function connected_out_to_peer

connectd/connectd.c:166–185  ·  view source on GitHub ↗

~ Once we've connected out, we disable the callback which would cause us to * to try the next address. */

Source from the content-addressed store, hash-verified

164/*~ Once we've connected out, we disable the callback which would cause us to
165 * to try the next address. */
166static void connected_out_to_peer(struct daemon *daemon,
167 struct io_conn *conn,
168 const struct node_id *id)
169{
170 struct connecting *connect = find_connecting(daemon, id);
171
172 /* We allocate 'conn' as a child of 'connect': we don't want to free
173 * it just yet though. tal_steal() it onto the permanent 'daemon'
174 * struct. */
175 tal_steal(daemon, conn);
176
177 /* We only allow one outgoing attempt at a time */
178 assert(connect->conn == conn);
179
180 /* Don't call destroy_io_conn, since we're done. */
181 io_set_finish(conn, NULL, NULL);
182
183 /* Now free the 'connecting' struct. */
184 tal_free(connect);
185}
186
187/*~ Once they've connected in, stop trying to connect out (if we were). */
188static void peer_connected_in(struct daemon *daemon,

Callers 1

peer_connectedFunction · 0.85

Calls 2

find_connectingFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected