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

Function plugin_dynamic_list_plugins

lightningd/plugin_control.c:22–41  ·  view source on GitHub ↗

* Returned by all subcommands on success. */

Source from the content-addressed store, hash-verified

20 * Returned by all subcommands on success.
21 */
22static struct command_result *plugin_dynamic_list_plugins(struct plugin_command *pcmd,
23 const struct plugins *plugins)
24{
25 struct json_stream *response;
26 const struct plugin *p;
27
28 response = json_stream_success(pcmd->cmd);
29 json_add_string(response, "command", pcmd->subcmd);
30 json_array_start(response, "plugins");
31 list_for_each(&plugins->plugins, p, list) {
32 json_object_start(response, NULL);
33 json_add_string(response, "name", p->cmd);
34 json_add_bool(response, "active",
35 p->plugin_state == INIT_COMPLETE);
36 json_add_bool(response, "dynamic", p->dynamic);
37 json_object_end(response);
38 }
39 json_array_end(response);
40 return command_success(pcmd->cmd, response);
41}
42
43struct command_result *plugin_cmd_killed(struct plugin_command *pcmd,
44 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_stream_successFunction · 0.70
command_successFunction · 0.70
json_add_stringFunction · 0.50
json_array_startFunction · 0.50
json_object_startFunction · 0.50
json_add_boolFunction · 0.50
json_object_endFunction · 0.50
json_array_endFunction · 0.50

Tested by

no test coverage detected