libplugin: make deprecated_apis a global

This commit is contained in:
darosior
2020-02-05 00:16:01 +01:00
committed by Rusty Russell
parent 02fe34ed95
commit b6b2e6727e
3 changed files with 7 additions and 5 deletions

View File

@@ -314,7 +314,7 @@ static struct command_result *fundchannel_start(struct command *cmd,
json_out_start(ret, NULL, '{');
json_out_addstr(ret, "id", node_id_to_hexstr(tmpctx, fr->id));
if (cmd->plugin->deprecated_apis)
if (deprecated_apis)
json_out_addstr(ret, "satoshi", fr->funding_str);
else
json_out_addstr(ret, "amount", fr->funding_str);
@@ -446,7 +446,7 @@ static struct command_result *json_fundchannel(struct command *cmd,
struct funding_req *fr = tal(cmd, struct funding_req);
/* For generating help, give new-style. */
if (!params || !cmd->plugin->deprecated_apis || params->type == JSMN_ARRAY) {
if (!params || !deprecated_apis || params->type == JSMN_ARRAY) {
if (!param(cmd, buf, params,
p_req("id", param_node_id, &fr->id),
p_req("amount", param_string_check_sat, &fr->funding_str),