mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 05:04:21 +01:00
jsonrpc: Add confirmation status to listfunds output
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user