mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
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
This commit is contained in:
parent
34cef2cac3
commit
4e30a82f09
@ -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…
Reference in New Issue
Block a user