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

Function plugin_dynamic_startdir

lightningd/plugin_control.c:93–110  ·  view source on GitHub ↗

* Called when trying to start a plugin directory through RPC, it registers * all contained plugins recursively and then starts them. */

Source from the content-addressed store, hash-verified

91 * all contained plugins recursively and then starts them.
92 */
93static struct command_result *
94plugin_dynamic_startdir(struct plugin_command *pcmd, const char *dir_path)
95{
96 const char *err;
97 struct command_result *res;
98
99 err = add_plugin_dir(pcmd->cmd->ld->plugins, dir_path, false);
100 if (err)
101 return command_fail(pcmd->cmd, JSONRPC2_INVALID_PARAMS, "%s", err);
102
103 /* If none added, this calls plugin_cmd_all_complete immediately */
104 res = plugin_register_all_complete(pcmd->cmd->ld, pcmd);
105 if (res)
106 return res;
107
108 plugins_send_getmanifest(pcmd->cmd->ld->plugins, pcmd->cmd->id);
109 return command_still_pending(pcmd->cmd);
110}
111
112static struct command_result *plugin_stop(struct command *cmd, struct plugin *p,
113 bool kill)

Callers 1

json_plugin_controlFunction · 0.85

Calls 5

add_plugin_dirFunction · 0.85
plugins_send_getmanifestFunction · 0.85
command_failFunction · 0.70
command_still_pendingFunction · 0.70

Tested by

no test coverage detected