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

Function perform_signpsbt

plugins/spender/multifundchannel.c:665–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665struct command_result *
666perform_signpsbt(struct multifundchannel_command *mfc)
667{
668 struct out_req *req;
669
670 /* Now we sign our inputs. You do remember which inputs
671 * are yours, right? */
672 plugin_log(mfc->cmd->plugin, LOG_DBG,
673 "mfc %"PRIu64": signpsbt.", mfc->id);
674
675 req = jsonrpc_request_start(mfc->cmd,
676 "signpsbt",
677 &after_signpsbt,
678 &mfc_forward_error,
679 mfc);
680 json_add_psbt(req->js, "psbt", mfc->psbt);
681
682 /* Use input markers to identify which inputs
683 * are ours, only sign those */
684 json_array_start(req->js, "signonly");
685 for (size_t i = 0; i < mfc->psbt->num_inputs; i++) {
686 if (psbt_input_is_ours(&mfc->psbt->inputs[i]))
687 json_add_num(req->js, NULL, i);
688 }
689 json_array_end(req->js);
690 return send_outreq(req);
691}
692
693/*~
694Finally with everything set up correctly we `signpsbt`+`sendpsbt` the

Callers 2

collect_sigsFunction · 0.85

Calls 7

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

Tested by

no test coverage detected