| 188 | } |
| 189 | |
| 190 | static void tell_connectd_custommsgs(struct plugins *plugins) |
| 191 | { |
| 192 | struct plugin *p; |
| 193 | u16 *all_msgs = tal_arr(tmpctx, u16, 0); |
| 194 | |
| 195 | /* Not when shutting down */ |
| 196 | if (!plugins->ld->connectd) |
| 197 | return; |
| 198 | |
| 199 | /* Gather from all plugins. */ |
| 200 | list_for_each(&plugins->plugins, p, list) |
| 201 | tal_arr_append(&all_msgs, p->custom_msgs); |
| 202 | |
| 203 | /* Don't bother sorting or uniquifying. If plugins are dumb, they deserve it. */ |
| 204 | subd_send_msg(plugins->ld->connectd, |
| 205 | take(towire_connectd_set_custommsgs(NULL, all_msgs))); |
| 206 | } |
| 207 | |
| 208 | /* Steal req onto reqs. */ |
| 209 | static bool request_add(const char *reqid, struct jsonrpc_request *req, |
no test coverage detected