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

Function collect_sigs

plugins/spender/openchannel.c:471–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471static struct command_result *
472collect_sigs(struct multifundchannel_command *mfc)
473{
474 /* There's a very small chance that we'll get a
475 * race condition between when a signature arrives
476 * and all of the fundchannel_completes return.
477 * This flag helps us avoid invoking this twice.*/
478 if (mfc->sigs_collected)
479 return NULL;
480
481 mfc->sigs_collected = true;
482 /* But first! we sanity check that everyone's
483 * expecting the same funding txid */
484 for (size_t i = 0; i < tal_count(mfc->destinations); i++) {
485 struct multifundchannel_destination *dest;
486 struct bitcoin_txid dest_txid;
487 dest = &mfc->destinations[i];
488
489 if (!is_v2(dest)) {
490 /* Since we're here, double check that
491 * every v1 has their commitment txs */
492 assert(dest->state == MULTIFUNDCHANNEL_COMPLETED);
493 continue;
494 }
495
496 assert(dest->state == MULTIFUNDCHANNEL_SIGNED);
497 psbt_txid(NULL, dest->psbt, &dest_txid, NULL);
498
499 assert(bitcoin_txid_eq(mfc->txid, &dest_txid));
500 }
501
502 return perform_signpsbt(mfc);
503}
504
505struct command_result *
506check_sigs_ready(struct multifundchannel_command *mfc)

Callers 1

check_sigs_readyFunction · 0.85

Calls 3

is_v2Function · 0.85
psbt_txidFunction · 0.85
perform_signpsbtFunction · 0.85

Tested by

no test coverage detected