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