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

Function mw_perform_cleanup

plugins/spender/multiwithdraw.c:231–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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