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

Function unreserve_psbt

plugins/funder.c:98–124  ·  view source on GitHub ↗

Frees open (eventually, in unreserve_done callback) */

Source from the content-addressed store, hash-verified

96
97/* Frees open (eventually, in unreserve_done callback) */
98static struct command_result *unreserve_psbt(struct command *cmd,
99 struct pending_open *open)
100{
101 struct out_req *req;
102 struct command *aux;
103
104 plugin_log(open->p, LOG_DBG,
105 "Calling `unreserveinputs` for channel %s",
106 fmt_channel_id(tmpctx,
107 &open->channel_id));
108
109 /* This can outlive the underlying cmd, so use an aux! */
110 aux = aux_command(cmd);
111 req = jsonrpc_request_start(aux,
112 "unreserveinputs",
113 unreserve_done, unreserve_done,
114 open);
115 json_add_psbt(req->js, "psbt", open->psbt);
116 send_outreq(req);
117
118 /* We will free this in callback, but remove from list *now*
119 * to avoid calling twice! */
120 list_del_from(&pending_opens, &open->list);
121 tal_steal(aux, open);
122
123 return command_still_pending(aux);
124}
125
126static void cleanup_peer_pending_opens(struct command *cmd,
127 const struct node_id *id)

Callers 2

json_channel_open_failedFunction · 0.85

Calls 7

json_add_psbtFunction · 0.85
list_del_fromFunction · 0.85
plugin_logFunction · 0.70
aux_commandFunction · 0.70
send_outreqFunction · 0.70
command_still_pendingFunction · 0.70
fmt_channel_idFunction · 0.50

Tested by

no test coverage detected