From 4e2c1dd0385b95f1d1ec9608fffffcdcae9d6449 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 21 Feb 2018 23:48:01 +0100 Subject: [PATCH] jsonrpc: Add confirmation status to `listfunds` output Signed-off-by: Christian Decker --- wallet/walletrpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 1ac3b19a1..53a8369ca 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -383,6 +383,14 @@ static void json_listfunds(struct command *cmd, const char *buffer UNUSED, json_add_txid(response, "txid", &utxos[i]->txid); json_add_num(response, "output", utxos[i]->outnum); json_add_u64(response, "value", utxos[i]->amount); + + if (utxos[i]->spendheight) + json_add_string(response, "status", "spent"); + else if (utxos[i]->blockheight) + json_add_string(response, "status", "confirmed"); + else + json_add_string(response, "status", "unconfirmed"); + json_object_end(response); } json_array_end(response);