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

Function psbt_add_serials

common/psbt_open.c:494–513  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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)
495{
496 u64 serial_id;
497 for (size_t i = 0; i < psbt->num_inputs; i++) {
498 /* Skip ones that already have a serial id */
499 if (psbt_get_serial_id(&psbt->inputs[i].unknowns, &serial_id))
500 continue;
501
502 serial_id = psbt_new_input_serial(psbt, role);
503 psbt_input_set_serial_id(psbt, &psbt->inputs[i], serial_id);
504 }
505 for (size_t i = 0; i < psbt->num_outputs; i++) {
506 /* Skip ones that already have a serial id */
507 if (psbt_get_serial_id(&psbt->outputs[i].unknowns, &serial_id))
508 continue;
509
510 serial_id = psbt_new_output_serial(psbt, role);
511 psbt_output_set_serial_id(psbt, &psbt->outputs[i], serial_id);
512 }
513}
514
515void psbt_input_mark_ours(const tal_t *ctx,
516 struct wally_psbt_input *input)

Callers 9

splice_initiatorFunction · 0.85
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