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

Function unreserve_get_result

plugins/spender/splice.c:112–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static 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
150static struct command_result *abort_get_result(struct command *cmd,
151 const char *methodname,

Callers 1

handle_wetrunFunction · 0.85

Calls 13

json_add_psbtFunction · 0.85
bitcoin_tx_with_psbtFunction · 0.85
linearize_txFunction · 0.85
json_add_hexFunction · 0.85
tal_bytelenFunction · 0.85
json_add_txidFunction · 0.85
json_array_startFunction · 0.85
debug_log_to_jsonFunction · 0.85
json_array_endFunction · 0.85
tal_freeFunction · 0.85
make_errorFunction · 0.85
jsonrpc_stream_successFunction · 0.50

Tested by

no test coverage detected