MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_add_reservestatus

Function json_add_reservestatus

wallet/reservation.c:29–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29static void json_add_reservestatus(struct json_stream *response,
30 const struct utxo *utxo,
31 enum output_status oldstatus,
32 u32 old_res,
33 u32 current_height)
34{
35 json_object_start(response, NULL);
36 json_add_txid(response, "txid", &utxo->outpoint.txid);
37 json_add_u32(response, "vout", utxo->outpoint.n);
38 json_add_bool(response, "was_reserved",
39 was_reserved(oldstatus, old_res, current_height));
40 json_add_bool(response, "reserved",
41 utxo_is_reserved(utxo, current_height));
42 if (utxo_is_reserved(utxo, current_height))
43 json_add_u32(response, "reserved_to_block",
44 utxo->reserved_til);
45 json_object_end(response);
46}
47
48/* Reserve these UTXOs and print to JSON */
49static void reserve_and_report(struct json_stream *response,

Callers 2

reserve_and_reportFunction · 0.85
json_unreserveinputsFunction · 0.85

Calls 7

json_object_startFunction · 0.85
json_add_txidFunction · 0.85
json_add_u32Function · 0.85
json_add_boolFunction · 0.85
was_reservedFunction · 0.85
utxo_is_reservedFunction · 0.85
json_object_endFunction · 0.85

Tested by

no test coverage detected