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

Function find_subd

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

Source from the content-addressed store, hash-verified

61 struct peer *peer);
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 sent it tx_abort, we pretend it doesn't exist */
70 if (subd->rcvd_tx_abort)
71 continue;
72
73 /* Once we see a message using the real channel_id, we
74 * clear the temporary_channel_id */
75 if (channel_id_eq(&subd->channel_id, channel_id)) {
76 subd->temporary_channel_id
77 = tal_free(subd->temporary_channel_id);
78 return subd;
79 }
80 if (subd->temporary_channel_id
81 && channel_id_eq(subd->temporary_channel_id, channel_id)) {
82 return subd;
83 }
84 }
85 return NULL;
86}
87
88/* We try to send the final messages, but if buffer is full and they're
89 * not reading, we have to give up. */

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