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

Function unreserve_call

plugins/spender/multifundchannel.c:169–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169static struct command_result *unreserve_call(struct command *cmd,
170 struct wally_psbt *psbt,
171 void *cb, void *cbdata)
172{
173 struct wally_psbt *pruned_psbt;
174 struct out_req *req = jsonrpc_request_start(cmd,
175 "unreserveinputs",
176 cb, cb, cbdata);
177
178 /* We might have peer's inputs on this, get rid of them */
179 tal_wally_start();
180 if (wally_psbt_clone_alloc(psbt, 0, &pruned_psbt) != WALLY_OK)
181 abort();
182 tal_wally_end_onto(NULL, pruned_psbt, struct wally_psbt);
183
184 for (size_t i = pruned_psbt->num_inputs - 1;
185 i < pruned_psbt->num_inputs;
186 i--) {
187 if (!psbt_input_is_ours(&pruned_psbt->inputs[i]))
188 psbt_rm_input(pruned_psbt, i);
189 }
190
191 json_add_psbt(req->js, "psbt", take(pruned_psbt));
192 json_add_u32(req->js, "reserve", 2016);
193 return send_outreq(req);
194}
195
196/* Cleans up a txid by doing `txdiscard` on it. */
197static void

Callers 2

mfc_cleanup_psbtFunction · 0.85
after_fundpsbtFunction · 0.85

Calls 7

tal_wally_startFunction · 0.85
abortFunction · 0.85
psbt_input_is_oursFunction · 0.85
psbt_rm_inputFunction · 0.85
json_add_psbtFunction · 0.85
json_add_u32Function · 0.85
send_outreqFunction · 0.50

Tested by

no test coverage detected