| 226 | } |
| 227 | |
| 228 | static void plugin_hook_call_next(struct plugin_hook_request *ph_req) |
| 229 | { |
| 230 | struct jsonrpc_request *req; |
| 231 | const struct plugin_hook *hook = ph_req->hook; |
| 232 | assert(!list_empty(&ph_req->call_chain)); |
| 233 | ph_req->plugin = list_top(&ph_req->call_chain, struct plugin_hook_call_link, list)->plugin; |
| 234 | |
| 235 | log_debug(ph_req->ld->log, "Calling %s hook of plugin %s", |
| 236 | ph_req->hook->name, ph_req->plugin->shortname); |
| 237 | req = jsonrpc_request_start(NULL, hook->name, ph_req->cmd_id, |
| 238 | plugin_get_log(ph_req->plugin), |
| 239 | NULL, |
| 240 | plugin_hook_callback, ph_req); |
| 241 | |
| 242 | hook->serialize_payload(ph_req->cb_arg, req->stream, ph_req->plugin); |
| 243 | jsonrpc_request_end(req); |
| 244 | plugin_request_send(ph_req->plugin, req); |
| 245 | } |
| 246 | |
| 247 | bool plugin_hook_call_(struct lightningd *ld, const struct plugin_hook *hook, |
| 248 | const char *cmd_id TAKES, |
no test coverage detected