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

Function mw_perform_cleanup

plugins/spender/multiwithdraw.c:232–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 struct multiwithdraw_cleanup *cleanup);
231
232static struct command_result *
233mw_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}
264static struct command_result *
265mw_after_cleanup(struct command *cmd UNUSED,
266 const char *buf 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