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

Function find_subd

connectd/multiplex.c:63–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61};
62
63static struct subd *find_subd(struct peer *peer,
64 const struct channel_id *channel_id)
65{
66 for (size_t i = 0; i < tal_count(peer->subds); i++) {
67 struct subd *subd = peer->subds[i];
68
69 /* Once we see a message using the real channel_id, we
70 * clear the temporary_channel_id */
71 if (channel_id_eq(&subd->channel_id, channel_id)) {
72 subd->temporary_channel_id
73 = tal_free(subd->temporary_channel_id);
74 return subd;
75 }
76 if (subd->temporary_channel_id
77 && channel_id_eq(subd->temporary_channel_id, channel_id)) {
78 return subd;
79 }
80 }
81 return NULL;
82}
83
84/* Except for a reconnection, we finally free a peer when the io_conn
85 * is closed and all subds are gone. */

Callers 2

read_body_from_peer_doneFunction · 0.85
peer_connect_subdFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected