| 1221 | } |
| 1222 | |
| 1223 | static void plugin_notify_cb(const char *buffer, |
| 1224 | const jsmntok_t *methodtok, |
| 1225 | const jsmntok_t *paramtoks, |
| 1226 | const jsmntok_t *idtok, |
| 1227 | struct command *cmd) |
| 1228 | { |
| 1229 | struct json_stream *response; |
| 1230 | |
| 1231 | if (!cmd->jcon || !cmd->send_notifications) |
| 1232 | return; |
| 1233 | |
| 1234 | response = json_stream_raw_for_cmd(cmd); |
| 1235 | json_object_start(response, NULL); |
| 1236 | json_add_string(response, "jsonrpc", "2.0"); |
| 1237 | json_add_tok(response, "method", methodtok, buffer); |
| 1238 | json_stream_append(response, ",\"params\":", strlen(",\"params\":")); |
| 1239 | json_stream_forward_change_id(response, buffer, |
| 1240 | paramtoks, idtok, cmd->id); |
| 1241 | json_object_end(response); |
| 1242 | |
| 1243 | json_stream_double_cr(response); |
| 1244 | json_stream_flush(response); |
| 1245 | } |
| 1246 | |
| 1247 | struct plugin *find_plugin_for_command(struct lightningd *ld, |
| 1248 | const char *cmd_name) |
nothing calls this directly
no test coverage detected