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

Function plugin_notify_cb

lightningd/plugin.c:1078–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1076}
1077
1078static void plugin_notify_cb(const char *buffer,
1079 const jsmntok_t *methodtok,
1080 const jsmntok_t *paramtoks,
1081 const jsmntok_t *idtok,
1082 struct plugin_rpccall *call)
1083{
1084 struct command *cmd = call->cmd;
1085 struct json_stream *response;
1086
1087 if (!cmd->jcon || !cmd->send_notifications)
1088 return;
1089
1090 response = json_stream_raw_for_cmd(cmd);
1091 json_object_start(response, NULL);
1092 json_add_string(response, "jsonrpc", "2.0");
1093 json_add_tok(response, "method", methodtok, buffer);
1094 json_stream_append(response, ",\"params\":", strlen(",\"params\":"));
1095 json_stream_forward_change_id(response, buffer,
1096 paramtoks, idtok, cmd->id,
1097 cmd->id_is_string);
1098 json_object_end(response);
1099
1100 json_stream_double_cr(response);
1101 json_stream_flush(response);
1102}
1103
1104struct plugin *find_plugin_for_command(struct lightningd *ld,
1105 const char *cmd_name)

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected