| 110 | } |
| 111 | |
| 112 | static struct command_result *unreserve_get_result(struct command *cmd, |
| 113 | const char *methodname, |
| 114 | const char *buf, |
| 115 | const jsmntok_t *result, |
| 116 | struct abort_pkg *abort_pkg) |
| 117 | { |
| 118 | struct splice_cmd *splice_cmd = abort_pkg->splice_cmd; |
| 119 | struct json_stream *response; |
| 120 | struct bitcoin_tx *tx; |
| 121 | u8 *tx_bytes; |
| 122 | |
| 123 | if (splice_cmd->wetrun) { |
| 124 | |
| 125 | response = jsonrpc_stream_success(cmd); |
| 126 | if (splice_cmd->psbt) { |
| 127 | json_add_psbt(response, "psbt", splice_cmd->psbt); |
| 128 | |
| 129 | tx = bitcoin_tx_with_psbt(tmpctx, splice_cmd->psbt); |
| 130 | tx_bytes = linearize_tx(tmpctx, tx); |
| 131 | json_add_hex(response, "tx", tx_bytes, |
| 132 | tal_bytelen(tx_bytes)); |
| 133 | json_add_txid(response, "txid", |
| 134 | &splice_cmd->final_txid); |
| 135 | } |
| 136 | |
| 137 | if (splice_cmd->debug_log) { |
| 138 | json_array_start(response, "log"); |
| 139 | debug_log_to_json(response, splice_cmd->debug_log); |
| 140 | json_array_end(response); |
| 141 | } |
| 142 | |
| 143 | tal_free(abort_pkg); |
| 144 | return command_finished(cmd, response); |
| 145 | } |
| 146 | |
| 147 | return make_error(cmd, abort_pkg, "unreserve_get_result"); |
| 148 | } |
| 149 | |
| 150 | static struct command_result *abort_get_result(struct command *cmd, |
| 151 | const char *methodname, |
no test coverage detected