lightningd/plugin_control: don't control non-dynamic plugins

This commit is contained in:
darosior
2019-07-18 15:32:48 +02:00
committed by Rusty Russell
parent 12e28c2554
commit 307fb0708e
3 changed files with 36 additions and 0 deletions

View File

@@ -39,6 +39,10 @@ static struct command_result *json_plugin_control(struct command *cmd,
plugin_found = false;
list_for_each(&cmd->ld->plugins->plugins, p, list) {
if (plugin_paths_match(p->cmd, plugin_name)) {
if (!p->dynamic)
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"%s plugin cannot be managed when lightningd is up",
plugin_name);
plugin_found = true;
plugin_hook_unregister_all(p);
plugin_kill(p, "%s stopped by lightningd via RPC",