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

Function psbt_side_finalized

common/psbt_open.c:476–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476bool psbt_side_finalized(const struct wally_psbt *psbt, enum tx_role role)
477{
478 u64 serial_id;
479 for (size_t i = 0; i < psbt->num_inputs; i++) {
480 if (!psbt_get_serial_id(&psbt->inputs[i].unknowns,
481 &serial_id)) {
482 return false;
483 }
484 if (serial_id % 2 == role) {
485 if (!psbt->inputs[i].final_witness ||
486 psbt->inputs[i].final_witness->num_items == 0)
487 return false;
488 }
489 }
490 return true;
491}
492
493/* Adds serials to inputs + outputs that don't have one yet */
494void psbt_add_serials(struct wally_psbt *psbt, enum tx_role role)

Callers 3

json_openchannel_signedFunction · 0.85
do_reconnect_danceFunction · 0.85

Calls 1

psbt_get_serial_idFunction · 0.85

Tested by

no test coverage detected