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

Function openchannel_finished

plugins/spender/openchannel.c:335–370  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

after_openchannel_signedFunction · 0.85

Calls 9

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

Tested by

no test coverage detected