Browse Source

plugins: pass back opts as indicated type. fixes #3577

Changelog-Fixed: Plugins: if an option has a type int or bool, return the option as that type to the plugin's init
travis-debug
lisa neigut 5 years ago
committed by Rusty Russell
parent
commit
4e30a82f09
  1. 8
      lightningd/plugin.c

8
lightningd/plugin.c

@ -1102,6 +1102,14 @@ plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)
list_for_each(&plugin->plugin_opts, opt, list) {
/* Trim the `--` that we added before */
name = opt->name + 2;
if (opt->value->as_bool) {
json_add_bool(req->stream, name, *opt->value->as_bool);
continue;
}
if (opt->value->as_int) {
json_add_s64(req->stream, name, *opt->value->as_int);
continue;
}
if (opt->value->as_str) {
json_add_string(req->stream, name, opt->value->as_str);
}

Loading…
Cancel
Save