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

Function plugin_notify_cb

lightningd/plugin.c:1223–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221}
1222
1223static 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
1247struct plugin *find_plugin_for_command(struct lightningd *ld,
1248 const char *cmd_name)

Callers

nothing calls this directly

Calls 9

json_stream_raw_for_cmdFunction · 0.85
json_object_startFunction · 0.85
json_add_tokFunction · 0.85
json_stream_appendFunction · 0.85
json_object_endFunction · 0.85
json_stream_double_crFunction · 0.85
json_stream_flushFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected