From 8015e7dcfb6b4567c5892244b2941123a16afc42 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 8 Dec 2018 11:04:56 +1030 Subject: [PATCH] jsonrpc: add the obj token to the callback. This (will) avoid the plugin having to walk back from the params object as it currently does. No code changes; I removed UNUSED and UNNEEDED labels from the other parameters though (as *every* json_rpc callback needs to call param() these days, they're *always* used). Signed-off-by: Rusty Russell --- lightningd/chaintopology.c | 4 +++- lightningd/connect_control.c | 4 +++- lightningd/gossip_control.c | 25 +++++++++++++++++++------ lightningd/invoice.c | 29 ++++++++++++++++++++++------- lightningd/jsonrpc.c | 34 ++++++++++++++++++++++++---------- lightningd/jsonrpc.h | 4 +++- lightningd/log.c | 4 +++- lightningd/memdump.c | 10 ++++++---- lightningd/opening_control.c | 4 +++- lightningd/options.c | 4 +++- lightningd/pay.c | 14 ++++++++++---- lightningd/payalgo.c | 4 +++- lightningd/peer_control.c | 32 ++++++++++++++++++++++++-------- lightningd/peer_htlcs.c | 10 +++++++--- lightningd/ping.c | 4 +++- lightningd/plugin.c | 1 + lightningd/test/run-param.c | 6 ++++-- wallet/walletrpc.c | 25 +++++++++++++++++-------- 18 files changed, 158 insertions(+), 60 deletions(-) diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 8a31e9326..9fe3db227 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -463,7 +463,9 @@ u32 feerate_to_style(u32 feerate_perkw, enum feerate_style style) } static void json_feerates(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct chain_topology *topo = cmd->ld->topology; struct json_stream *response; diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 46a75debe..68cc51d90 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -74,7 +74,9 @@ static void connect_cmd_succeed(struct command *cmd, const struct pubkey *id) } static void json_connect(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u32 *port; jsmntok_t *idtok; diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 7ca3e5498..a0230437f 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -243,8 +243,10 @@ static void json_getnodes_reply(struct subd *gossip UNUSED, const u8 *reply, command_success(cmd, response); } -static void json_listnodes(struct command *cmd, const char *buffer, - const jsmntok_t *params) +static void json_listnodes(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u8 *req; struct pubkey *id; @@ -286,7 +288,10 @@ static void json_getroute_reply(struct subd *gossip UNUSED, const u8 *reply, con command_success(cmd, response); } -static void json_getroute(struct command *cmd, const char *buffer, const jsmntok_t *params) +static void json_getroute(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct lightningd *ld = cmd->ld; struct pubkey *destination; @@ -393,8 +398,10 @@ static void json_listchannels_reply(struct subd *gossip UNUSED, const u8 *reply, command_success(cmd, response); } -static void json_listchannels(struct command *cmd, const char *buffer, - const jsmntok_t *params) +static void json_listchannels(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u8 *req; struct short_channel_id *id; @@ -443,7 +450,9 @@ static void json_scids_reply(struct subd *gossip UNUSED, const u8 *reply, } static void json_dev_query_scids(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u8 *msg; const jsmntok_t *scidstok; @@ -486,6 +495,7 @@ AUTODATA(json_command, &dev_query_scids_command); static void json_dev_send_timestamp_filter(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u8 *msg; @@ -555,6 +565,7 @@ static void json_channel_range_reply(struct subd *gossip UNUSED, const u8 *reply static void json_dev_query_channel_range(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u8 *msg; @@ -584,6 +595,7 @@ AUTODATA(json_command, &dev_query_channel_range_command); static void json_dev_set_max_scids_encode_size(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u8 *msg; @@ -609,6 +621,7 @@ AUTODATA(json_command, &dev_set_max_scids_encode_size); static void json_dev_suppress_gossip(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { if (!param(cmd, buffer, params, NULL)) diff --git a/lightningd/invoice.c b/lightningd/invoice.c index 8e22b7bb8..bade4f930 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -292,7 +292,9 @@ static void gossipd_incoming_channels_reply(struct subd *gossipd, } static void json_invoice(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const jsmntok_t *fallbacks; const jsmntok_t *preimagetok; @@ -415,7 +417,9 @@ static void json_add_invoices(struct json_stream *response, } static void json_listinvoices(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_escaped *label; struct json_stream *response; @@ -441,7 +445,9 @@ static const struct json_command listinvoices_command = { AUTODATA(json_command, &listinvoices_command); static void json_delinvoice(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct invoice i; const struct invoice_details *details; @@ -492,7 +498,9 @@ static const struct json_command delinvoice_command = { }; AUTODATA(json_command, &delinvoice_command); -static void json_delexpiredinvoice(struct command *cmd, const char *buffer, +static void json_delexpiredinvoice(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u64 *maxexpirytime; @@ -516,6 +524,7 @@ AUTODATA(json_command, &delexpiredinvoice_command); static void json_autocleaninvoice(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u64 *cycle; @@ -541,7 +550,9 @@ static const struct json_command autocleaninvoice_command = { AUTODATA(json_command, &autocleaninvoice_command); static void json_waitanyinvoice(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u64 *pay_index; struct wallet *wallet = cmd->ld->wallet; @@ -575,7 +586,9 @@ AUTODATA(json_command, &waitanyinvoice_command); * waiters, if the payment is still pending. */ static void json_waitinvoice(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct invoice i; const struct invoice_details *details; @@ -648,7 +661,9 @@ static void json_add_fallback(struct json_stream *response, } static void json_decodepay(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct bolt11 *b11; struct json_stream *response; diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 0c164e147..857ac92ac 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -134,7 +134,9 @@ static void destroy_jcon(struct json_connection *jcon) } static void json_help(struct command *cmd, - const char *buffer, const jsmntok_t *params); + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params); static const struct json_command help_command = { "help", @@ -151,7 +153,9 @@ static const struct json_command help_command = { AUTODATA(json_command, &help_command); static void json_stop(struct command *cmd, - const char *buffer UNUSED, const jsmntok_t *params UNUSED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; @@ -174,7 +178,9 @@ AUTODATA(json_command, &stop_command); #if DEVELOPER static void json_rhash(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNUSED, + const jsmntok_t *params) { struct json_stream *response; struct sha256 *secret; @@ -222,7 +228,9 @@ static void slowcmd_start(struct slowcmd *sc) } static void json_slowcmd(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNUSED, + const jsmntok_t *params) { struct slowcmd *sc = tal(cmd, struct slowcmd); @@ -244,7 +252,9 @@ static const struct json_command dev_slowcmd_command = { AUTODATA(json_command, &dev_slowcmd_command); static void json_crash(struct command *cmd UNUSED, - const char *buffer UNUSED, const jsmntok_t *params UNUSED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { if (!param(cmd, buffer, params, NULL)) return; @@ -277,7 +287,7 @@ static void json_add_help_command(struct command *cmd, { char *usage; cmd->mode = CMD_USAGE; - json_command->dispatch(cmd, NULL, NULL); + json_command->dispatch(cmd, NULL, NULL, NULL); usage = tal_fmt(cmd, "%s %s", json_command->name, cmd->usage); json_object_start(response, NULL); @@ -302,7 +312,9 @@ static void json_add_help_command(struct command *cmd, } static void json_help(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; const jsmntok_t *cmdtok; @@ -570,7 +582,7 @@ static void parse_request(struct json_connection *jcon, const jsmntok_t tok[]) } db_begin_transaction(jcon->ld->wallet->db); - c->json_cmd->dispatch(c, jcon->buffer, params); + c->json_cmd->dispatch(c, jcon->buffer, tok, params); db_commit_transaction(jcon->ld->wallet->db); /* If they didn't complete it, they must call command_still_pending. @@ -953,7 +965,9 @@ static bool json_tok_command(struct command *cmd, const char *name, } static void json_check(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { jsmntok_t *mod_params; const jsmntok_t *name_tok; @@ -984,7 +998,7 @@ static void json_check(struct command *cmd, * we're after and would be more clear. */ ok = true; cmd->ok = &ok; - cmd->json_cmd->dispatch(cmd, buffer, mod_params); + cmd->json_cmd->dispatch(cmd, buffer, mod_params, mod_params); if (!ok) return; diff --git a/lightningd/jsonrpc.h b/lightningd/jsonrpc.h index da21d36ef..bc3735887 100644 --- a/lightningd/jsonrpc.h +++ b/lightningd/jsonrpc.h @@ -47,7 +47,9 @@ struct command { struct json_command { const char *name; void (*dispatch)(struct command *, - const char *buffer, const jsmntok_t *params); + const char *buffer, + const jsmntok_t *obj, + const jsmntok_t *params); const char *description; bool deprecated; const char *verbose; diff --git a/lightningd/log.c b/lightningd/log.c index b09d96d62..3dfd18f2c 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -716,7 +716,9 @@ bool json_tok_loglevel(struct command *cmd, const char *name, } static void json_getlog(struct command *cmd, - const char *buffer, const jsmntok_t * params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t * params) { struct json_stream *response; enum log_level *minlevel; diff --git a/lightningd/memdump.c b/lightningd/memdump.c index eb940d7ed..25797b7d3 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -62,8 +62,9 @@ static void add_memdump(struct json_stream *response, } static void json_memdump(struct command *cmd, - const char *buffer UNNEEDED, - const jsmntok_t *params UNNEEDED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; @@ -283,8 +284,9 @@ void opening_memleak_done(struct command *cmd, struct subd *leaker) } static void json_memleak(struct command *cmd, - const char *buffer UNNEEDED, - const jsmntok_t *params UNNEEDED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { if (!param(cmd, buffer, params, NULL)) return; diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index a11215a22..c08c7f16f 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -762,7 +762,9 @@ void opening_peer_no_active_channels(struct peer *peer) * json_fund_channel - Entrypoint for funding a channel */ static void json_fund_channel(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const jsmntok_t *sattok; struct funding_channel * fc = tal(cmd, struct funding_channel); diff --git a/lightningd/options.c b/lightningd/options.c index 7307ab73e..9d3881cb9 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1046,7 +1046,9 @@ static void add_config(struct lightningd *ld, } static void json_listconfigs(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { size_t i; struct json_stream *response = NULL; diff --git a/lightningd/pay.c b/lightningd/pay.c index 15aff6d03..61b4a7ce4 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -941,7 +941,9 @@ static void json_sendpay_on_resolve(const struct sendpay_result* r, } static void json_sendpay(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const jsmntok_t *routetok; const jsmntok_t *t, *end; @@ -1025,7 +1027,9 @@ static void waitsendpay_timeout(struct command *cmd) command_fail(cmd, PAY_IN_PROGRESS, "Timed out while waiting"); } -static void json_waitsendpay(struct command *cmd, const char *buffer, +static void json_waitsendpay(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { struct sha256 *rhash; @@ -1054,8 +1058,10 @@ static const struct json_command waitsendpay_command = { }; AUTODATA(json_command, &waitsendpay_command); -static void json_listpayments(struct command *cmd, const char *buffer, - const jsmntok_t *params) +static void json_listpayments(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const struct wallet_payment **payments; struct json_stream *response; diff --git a/lightningd/payalgo.c b/lightningd/payalgo.c index fe78a6942..ef525db95 100644 --- a/lightningd/payalgo.c +++ b/lightningd/payalgo.c @@ -592,7 +592,9 @@ static void json_pay_stop_retrying(struct pay *pay) } static void json_pay(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { double *riskfactor; double *maxfeepercent; diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 0607b5c8a..51e026e19 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -803,7 +803,9 @@ static void json_add_peer(struct lightningd *ld, } static void json_listpeers(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { enum log_level *ll; struct pubkey *specific_id; @@ -890,7 +892,9 @@ command_find_channel(struct command *cmd, } static void json_close(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const jsmntok_t *idtok; struct peer *peer; @@ -1032,7 +1036,9 @@ void load_channels_from_wallet(struct lightningd *ld) } static void json_disconnect(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct pubkey *id; struct peer *peer; @@ -1071,7 +1077,9 @@ static const struct json_command disconnect_command = { AUTODATA(json_command, &disconnect_command); static void json_getinfo(struct command *cmd, - const char *buffer UNUSED, const jsmntok_t *params UNUSED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; struct peer *peer; @@ -1144,7 +1152,9 @@ AUTODATA(json_command, &getinfo_command); #if DEVELOPER static void json_sign_last_tx(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct pubkey *peerid; struct peer *peer; @@ -1191,7 +1201,9 @@ static const struct json_command dev_sign_last_tx = { AUTODATA(json_command, &dev_sign_last_tx); static void json_dev_fail(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct pubkey *peerid; struct peer *peer; @@ -1236,7 +1248,9 @@ static void dev_reenable_commit_finished(struct subd *channeld UNUSED, } static void json_dev_reenable_commit(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct pubkey *peerid; struct peer *peer; @@ -1325,7 +1339,9 @@ static void process_dev_forget_channel(struct bitcoind *bitcoind UNUSED, command_success(forget->cmd, response); } -static void json_dev_forget_channel(struct command *cmd, const char *buffer, +static void json_dev_forget_channel(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { struct pubkey *peerid; diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 3eccba420..d7f620260 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -1791,7 +1791,9 @@ void htlcs_reconnect(struct lightningd *ld, #if DEVELOPER -static void json_dev_ignore_htlcs(struct command *cmd, const char *buffer, +static void json_dev_ignore_htlcs(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { struct pubkey *peerid; @@ -1846,8 +1848,10 @@ static void listforwardings_add_forwardings(struct json_stream *response, struct tal_free(forwardings); } -static void json_listforwards(struct command *cmd, const char *buffer, - const jsmntok_t *params) +static void json_listforwards(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; diff --git a/lightningd/ping.c b/lightningd/ping.c index b7471aa5c..115853f69 100644 --- a/lightningd/ping.c +++ b/lightningd/ping.c @@ -79,7 +79,9 @@ void ping_reply(struct subd *subd, const u8 *msg) } static void json_ping(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { u8 *msg; unsigned int *len, *pongbytes; diff --git a/lightningd/plugin.c b/lightningd/plugin.c index f75344fcb..3e2d4cd5f 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -534,6 +534,7 @@ static void plugin_rpcmethod_cb(const struct plugin_request *req, } static void plugin_rpcmethod_dispatch(struct command *cmd, const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { const jsmntok_t *toks = params, *methtok, *idtok; diff --git a/lightningd/test/run-param.c b/lightningd/test/run-param.c index c46c64c68..e5b090ede 100644 --- a/lightningd/test/run-param.c +++ b/lightningd/test/run-param.c @@ -507,7 +507,9 @@ static void json_tok_tests(void) test_cb(json_tok_percent, double, "[ 'wow' ]", 0, false); } -static void test_invoice(struct command *cmd, const char *buffer, +static void test_invoice(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) { u64 *msatoshi_val; @@ -546,7 +548,7 @@ static void usage(void) cmd->mode = CMD_USAGE; cmd->json_cmd = &invoice_command; - cmd->json_cmd->dispatch(cmd, NULL, NULL); + cmd->json_cmd->dispatch(cmd, NULL, NULL, NULL); assert(streq(cmd->usage, "msatoshi label description " diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 5f4a89838..a3771d43e 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -85,7 +85,9 @@ static void wallet_withdrawal_broadcast(struct bitcoind *bitcoind UNUSED, * the HSM to generate the signatures. */ static void json_withdraw(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { const jsmntok_t *desttok, *sattok; struct withdrawal *withdraw = tal(cmd, struct withdrawal); @@ -239,8 +241,10 @@ static bool json_tok_newaddr(struct command *cmd, const char *name, return false; } -static void json_newaddr(struct command *cmd, const char *buffer UNUSED, - const jsmntok_t *params UNUSED) +static void json_newaddr(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; struct ext_key ext; @@ -299,7 +303,9 @@ static const struct json_command newaddr_command = { AUTODATA(json_command, &newaddr_command); static void json_listaddrs(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; struct ext_key ext; @@ -376,8 +382,10 @@ static const struct json_command listaddrs_command = { }; AUTODATA(json_command, &listaddrs_command); -static void json_listfunds(struct command *cmd, const char *buffer UNUSED, - const jsmntok_t *params UNUSED) +static void json_listfunds(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct json_stream *response; struct peer *p; @@ -503,8 +511,9 @@ static void process_utxo_result(struct bitcoind *bitcoind, } static void json_dev_rescan_outputs(struct command *cmd, - const char *buffer UNUSED, - const jsmntok_t *params UNUSED) + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct txo_rescan *rescan = tal(cmd, struct txo_rescan);