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

Function openchannel_finished

plugins/spender/openchannel.c:327–359  ·  view source on GitHub ↗

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* * To collect signatures from our peers, we use a notification watcher. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* */

Source from the content-addressed store, hash-verified

325 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
326 */
327static struct command_result *
328openchannel_finished(struct multifundchannel_command *mfc)
329{
330 for (size_t i = 0; i < tal_count(mfc->destinations); i++) {
331 struct multifundchannel_destination *dest;
332 dest = &mfc->destinations[i];
333
334 /* If there's a single failure, we have to
335 * return the failure to the user. */
336 if (dest->state == MULTIFUNDCHANNEL_FAILED) {
337 struct json_stream *out;
338
339 plugin_log(mfc->cmd->plugin, LOG_DBG,
340 "mfc %"PRIu64": %u failed, failing.",
341 mfc->id, dest->index);
342
343 out = jsonrpc_stream_fail_data(mfc->cmd,
344 dest->error_code,
345 dest->error_message);
346 json_add_node_id(out, "id", &dest->id);
347 json_add_string(out, "method", "openchannel_signed");
348 if (dest->error_data)
349 json_add_jsonstr(out, "data",
350 dest->error_data,
351 strlen(dest->error_data));
352 json_object_end(out);
353
354 return mfc_finished(mfc, out);
355 }
356 }
357 mfc->psbt = tal_free(mfc->psbt);
358 return multifundchannel_finished(mfc);
359}
360
361static struct command_result *
362after_openchannel_signed(struct multifundchannel_command *mfc)

Callers 1

after_openchannel_signedFunction · 0.85

Calls 9

jsonrpc_stream_fail_dataFunction · 0.85
json_add_jsonstrFunction · 0.85
mfc_finishedFunction · 0.85
tal_freeFunction · 0.85
plugin_logFunction · 0.50
json_add_node_idFunction · 0.50
json_add_stringFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected