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

Function after_fundchannel_complete

plugins/spender/multifundchannel.c:679–711  ·  view source on GitHub ↗

~ Finally with everything set up correctly we `signpsbt`+`sendpsbt` the funding transaction. */

Source from the content-addressed store, hash-verified

677funding transaction.
678*/
679static struct command_result *
680after_fundchannel_complete(struct multifundchannel_command *mfc)
681{
682 unsigned int i;
683
684 plugin_log(mfc->cmd->plugin, LOG_DBG,
685 "mfc %"PRIu64": parallel fundchannel_complete done.",
686 mfc->id);
687
688 /* Check if any fundchannel_complete failed. */
689 for (i = 0; i < tal_count(mfc->destinations); ++i) {
690 struct multifundchannel_destination *dest;
691
692 dest = &mfc->destinations[i];
693 if (is_v2(dest))
694 continue;
695
696 assert(dest->state == MULTIFUNDCHANNEL_COMPLETED
697 || dest->state == MULTIFUNDCHANNEL_FAILED);
698
699 if (dest->state != MULTIFUNDCHANNEL_FAILED)
700 continue;
701
702 /* One of them failed, oh no. */
703 return redo_multifundchannel(mfc, "fundchannel_complete",
704 dest->error_message);
705 }
706
707 if (dest_count(mfc, OPEN_CHANNEL) > 0)
708 return check_sigs_ready(mfc);
709
710 return perform_signpsbt(mfc);
711}
712
713
714static struct command_result *

Callers 1

Calls 6

is_v2Function · 0.85
redo_multifundchannelFunction · 0.85
dest_countFunction · 0.85
check_sigs_readyFunction · 0.85
perform_signpsbtFunction · 0.85
plugin_logFunction · 0.50

Tested by

no test coverage detected