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

Function plugin_dynamic_list_plugins

lightningd/plugin_control.c:21–40  ·  view source on GitHub ↗

* Returned by all subcommands on success. */

Source from the content-addressed store, hash-verified

19 * Returned by all subcommands on success.
20 */
21static struct command_result *plugin_dynamic_list_plugins(struct plugin_command *pcmd,
22 const struct plugins *plugins)
23{
24 struct json_stream *response;
25 const struct plugin *p;
26
27 response = json_stream_success(pcmd->cmd);
28 json_add_string(response, "command", pcmd->subcmd);
29 json_array_start(response, "plugins");
30 list_for_each(&plugins->plugins, p, list) {
31 json_object_start(response, NULL);
32 json_add_string(response, "name", p->cmd);
33 json_add_bool(response, "active",
34 p->plugin_state == INIT_COMPLETE);
35 json_add_bool(response, "dynamic", p->dynamic);
36 json_object_end(response);
37 }
38 json_array_end(response);
39 return command_success(pcmd->cmd, response);
40}
41
42struct command_result *plugin_cmd_killed(struct plugin_command *pcmd,
43 struct plugin *plugin, const char *msg)

Callers 3

plugin_cmd_succeededFunction · 0.85
plugin_cmd_all_completeFunction · 0.85
json_plugin_controlFunction · 0.85

Calls 8

json_array_startFunction · 0.85
json_object_startFunction · 0.85
json_add_boolFunction · 0.85
json_object_endFunction · 0.85
json_array_endFunction · 0.85
json_stream_successFunction · 0.70
command_successFunction · 0.70
json_add_stringFunction · 0.50

Tested by

no test coverage detected