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

Function get_req

lightningd/subd.c:172–187  ·  view source on GitHub ↗

Caller must free. */

Source from the content-addressed store, hash-verified

170
171/* Caller must free. */
172static struct subd_req *get_req(struct subd *sd, int reply_type)
173{
174 struct subd_req *sr;
175
176 list_for_each(&sd->reqs, sr, list) {
177 if (sr->type + SUBD_REPLY_OFFSET == reply_type)
178 return sr;
179 /* If it's a fail, and that's a valid type. */
180 if (sr->type + SUBD_REPLYFAIL_OFFSET == reply_type
181 && strends(sd->msgname(reply_type), "_REPLYFAIL")) {
182 sr->num_reply_fds = 0;
183 return sr;
184 }
185 }
186 return NULL;
187}
188
189static void close_taken_fds(va_list *ap)
190{

Callers 1

sd_msg_readFunction · 0.85

Calls 1

strendsFunction · 0.85

Tested by

no test coverage detected