mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +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:
committed by
Rusty Russell
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) {
|
list_for_each(&plugin->plugin_opts, opt, list) {
|
||||||
/* Trim the `--` that we added before */
|
/* Trim the `--` that we added before */
|
||||||
name = opt->name + 2;
|
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) {
|
if (opt->value->as_str) {
|
||||||
json_add_string(req->stream, name, opt->value->as_str);
|
json_add_string(req->stream, name, opt->value->as_str);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user