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

Function psbt_side_finalized

common/psbt_open.c:428–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428bool psbt_side_finalized(const struct wally_psbt *psbt, enum tx_role role)
429{
430 u64 serial_id;
431 for (size_t i = 0; i < psbt->num_inputs; i++) {
432 if (!psbt_get_serial_id(&psbt->inputs[i].unknowns,
433 &serial_id)) {
434 return false;
435 }
436 if (serial_id % 2 == role) {
437 if (!psbt->inputs[i].final_witness ||
438 psbt->inputs[i].final_witness->num_items == 0)
439 return false;
440 }
441 }
442 return true;
443}
444
445/* Adds serials to inputs + outputs that don't have one yet */
446void 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