mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
jsonrpc: Add confirmation status to listfunds
output
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
227dc36146
commit
4e2c1dd038
1 changed files with 8 additions and 0 deletions
|
@ -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_txid(response, "txid", &utxos[i]->txid);
|
||||||
json_add_num(response, "output", utxos[i]->outnum);
|
json_add_num(response, "output", utxos[i]->outnum);
|
||||||
json_add_u64(response, "value", utxos[i]->amount);
|
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_object_end(response);
|
||||||
}
|
}
|
||||||
json_array_end(response);
|
json_array_end(response);
|
||||||
|
|
Loading…
Add table
Reference in a new issue