plugin: add in deprecated_api behavior and test

we also check that the node isn't running now, for extra pedancity
This commit is contained in:
lisa neigut
2020-03-07 18:24:47 -06:00
committed by Rusty Russell
parent b25a8ba29d
commit 41b18050a0
2 changed files with 22 additions and 3 deletions

View File

@@ -1128,11 +1128,13 @@ plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)
name = opt->name + 2;
if (opt->value->as_bool) {
json_add_bool(req->stream, name, *opt->value->as_bool);
continue;
if (!deprecated_apis)
continue;
}
if (opt->value->as_int) {
json_add_s64(req->stream, name, *opt->value->as_int);
continue;
if (!deprecated_apis)
continue;
}
if (opt->value->as_str) {
json_add_string(req->stream, name, opt->value->as_str);