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

Function mw_perform_cleanup

plugins/spender/multiwithdraw.c:229–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 struct multiwithdraw_cleanup *cleanup);
228
229static struct command_result *
230mw_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}
260static struct command_result *
261mw_after_cleanup(struct command *cmd UNUSED,
262 const char *method UNUSED,

Callers 2

mw_forward_errorFunction · 0.85
mw_failFunction · 0.85

Calls 5

takenFunction · 0.85
command_err_rawFunction · 0.85
json_add_psbtFunction · 0.85
plugin_logFunction · 0.50
send_outreqFunction · 0.50

Tested by

no test coverage detected