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

Function psbt_add_serials

common/psbt_open.c:446–465  ·  view source on GitHub ↗

Adds serials to inputs + outputs that don't have one yet */

Source from the content-addressed store, hash-verified

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)
447{
448 u64 serial_id;
449 for (size_t i = 0; i < psbt->num_inputs; i++) {
450 /* Skip ones that already have a serial id */
451 if (psbt_get_serial_id(&psbt->inputs[i].unknowns, &serial_id))
452 continue;
453
454 serial_id = psbt_new_input_serial(psbt, role);
455 psbt_input_set_serial_id(psbt, &psbt->inputs[i], serial_id);
456 }
457 for (size_t i = 0; i < psbt->num_outputs; i++) {
458 /* Skip ones that already have a serial id */
459 if (psbt_get_serial_id(&psbt->outputs[i].unknowns, &serial_id))
460 continue;
461
462 serial_id = psbt_new_output_serial(psbt, role);
463 psbt_output_set_serial_id(psbt, &psbt->outputs[i], serial_id);
464 }
465}
466
467void psbt_input_mark_ours(const tal_t *ctx,
468 struct wally_psbt_input *input)

Callers 8

json_openchannel_bumpFunction · 0.85
json_openchannel_updateFunction · 0.85
json_openchannel_initFunction · 0.85
mfc_psbt_acquiredFunction · 0.85

Calls 5

psbt_get_serial_idFunction · 0.85
psbt_new_input_serialFunction · 0.85
psbt_input_set_serial_idFunction · 0.85
psbt_new_output_serialFunction · 0.85

Tested by

no test coverage detected