libplugin: fix 'dynamic' field in getmanifest

As a separated commit because it was pre-existent (changelog + xfail test).

This also fix a logical problem in lightningd/plugin_control: we were
assuming a plugin started with 'plugin start' but which did not comport
a 'dynamic' entry in its manifest to be dynamic, though it should have
been treated as static.

Changelog-fixed: plugins: Dynamic C plugins can now be managed when lightningd is up
This commit is contained in:
darosior
2020-01-31 19:13:59 +01:00
committed by Rusty Russell
parent da476848d1
commit ceeb5503cc
4 changed files with 7 additions and 8 deletions

View File

@@ -591,8 +591,7 @@ handle_getmanifest(struct command *getmanifest_cmd)
json_add_string(params, NULL, p->hook_subs[i].name);
json_array_end(params);
json_add_string(params, "dynamic",
p->restartability == PLUGIN_RESTARTABLE ? "true" : "false");
json_add_bool(params, "dynamic", p->restartability == PLUGIN_RESTARTABLE);
return command_finished(getmanifest_cmd, params);
}