From 4e30a82f09e3a2a9254e1298377f6cdae46573b8 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Sat, 7 Mar 2020 18:10:20 -0600 Subject: [PATCH] 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 --- lightningd/plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 2db21cc9e..48ac879d2 100644 --- a/lightningd/plugin.c +++ b/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); }