| 227 | struct multiwithdraw_cleanup *cleanup); |
| 228 | |
| 229 | static struct command_result * |
| 230 | mw_perform_cleanup(struct multiwithdraw_command *mw, |
| 231 | char *error_json TAKES) |
| 232 | { |
| 233 | struct multiwithdraw_cleanup *cleanup; |
| 234 | struct out_req *req; |
| 235 | |
| 236 | if (!mw->psbt) { |
| 237 | plugin_log(mw->cmd->plugin, LOG_DBG, |
| 238 | "multiwithdraw %"PRIu64": no cleanup needed.", |
| 239 | mw->id); |
| 240 | if (taken(error_json)) |
| 241 | error_json = tal_steal(tmpctx, error_json); |
| 242 | return command_err_raw(mw->cmd, error_json); |
| 243 | } |
| 244 | |
| 245 | plugin_log(mw->cmd->plugin, LOG_DBG, |
| 246 | "multiwithdraw %"PRIu64": cleanup, unreserveinputs.", |
| 247 | mw->id); |
| 248 | |
| 249 | cleanup = tal(mw, struct multiwithdraw_cleanup); |
| 250 | cleanup->mw = mw; |
| 251 | cleanup->error_json = tal_strdup(cleanup, error_json); |
| 252 | |
| 253 | req = jsonrpc_request_start(mw->cmd, |
| 254 | "unreserveinputs", |
| 255 | &mw_after_cleanup, &mw_after_cleanup, |
| 256 | cleanup); |
| 257 | json_add_psbt(req->js, "psbt", mw->psbt); |
| 258 | return send_outreq(req); |
| 259 | } |
| 260 | static struct command_result * |
| 261 | mw_after_cleanup(struct command *cmd UNUSED, |
| 262 | const char *method UNUSED, |
no test coverage detected