| 27 | } |
| 28 | |
| 29 | static 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 */ |
| 49 | static void reserve_and_report(struct json_stream *response, |
no test coverage detected