From 5e7695f6a07431854d92d079cebd1cf689e80775 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 4 May 2021 14:03:43 -0500 Subject: [PATCH] funder: add count of utxos we're signing to the logs Useful for asserting how many inputs we're contributing --- plugins/funder.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/funder.c b/plugins/funder.c index cbddafb57..5f254394b 100644 --- a/plugins/funder.c +++ b/plugins/funder.c @@ -177,6 +177,7 @@ json_openchannel2_sign_call(struct command *cmd, const char *err; struct out_req *req; struct pending_open *open; + size_t count; err = json_scan(tmpctx, buf, params, "{openchannel2_sign:" @@ -219,16 +220,20 @@ json_openchannel2_sign_call(struct command *cmd, /* Use input markers to identify which inputs * are ours, only sign those */ json_array_start(req->js, "signonly"); + count = 0; for (size_t i = 0; i < psbt->num_inputs; i++) { - if (psbt_input_is_ours(&psbt->inputs[i])) + if (psbt_input_is_ours(&psbt->inputs[i])) { json_add_num(req->js, NULL, i); + count++; + } } json_array_end(req->js); plugin_log(cmd->plugin, LOG_DBG, - "calling `signpsbt` for channel %s", + "calling `signpsbt` for channel %s for %zu input%s", type_to_string(tmpctx, struct channel_id, - &open->channel_id)); + &open->channel_id), count, + count == 1 ? "" : "s"); return send_outreq(cmd->plugin, req); }