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

Function perform_signpsbt

plugins/spender/multifundchannel.c:647–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647struct command_result *
648perform_signpsbt(struct multifundchannel_command *mfc)
649{
650 struct out_req *req;
651
652 /* Now we sign our inputs. You do remember which inputs
653 * are yours, right? */
654 plugin_log(mfc->cmd->plugin, LOG_DBG,
655 "mfc %"PRIu64": signpsbt.", mfc->id);
656
657 req = jsonrpc_request_start(mfc->cmd->plugin, mfc->cmd,
658 "signpsbt",
659 &after_signpsbt,
660 &mfc_forward_error,
661 mfc);
662 json_add_psbt(req->js, "psbt", mfc->psbt);
663
664 /* Use input markers to identify which inputs
665 * are ours, only sign those */
666 json_array_start(req->js, "signonly");
667 for (size_t i = 0; i < mfc->psbt->num_inputs; i++) {
668 if (psbt_input_is_ours(&mfc->psbt->inputs[i]))
669 json_add_num(req->js, NULL, i);
670 }
671 json_array_end(req->js);
672 return send_outreq(mfc->cmd->plugin, req);
673}
674
675/*~
676Finally with everything set up correctly we `signpsbt`+`sendpsbt` the

Callers 2

collect_sigsFunction · 0.85

Calls 7

json_add_psbtFunction · 0.85
psbt_input_is_oursFunction · 0.85
plugin_logFunction · 0.50
json_array_startFunction · 0.50
json_add_numFunction · 0.50
json_array_endFunction · 0.50
send_outreqFunction · 0.50

Tested by

no test coverage detected