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

Function psbt_get_bytes

bitcoin/psbt.c:696–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694REGISTER_TYPE_TO_STRING(wally_psbt, psbt_to_b64);
695
696const u8 *psbt_get_bytes(const tal_t *ctx, const struct wally_psbt *psbt,
697 size_t *bytes_written)
698{
699 size_t len = 0;
700 u8 *bytes;
701
702 if (!psbt) {
703 *bytes_written = 0;
704 return NULL;
705 }
706
707 wally_psbt_get_length(psbt, 0, &len);
708 bytes = tal_arr(ctx, u8, len);
709
710 if (wally_psbt_to_bytes(psbt, 0, bytes, len, bytes_written) != WALLY_OK ||
711 *bytes_written != len) {
712 /* something went wrong. bad libwally ?? */
713 abort();
714 }
715 return bytes;
716}
717
718struct wally_psbt *psbt_from_bytes(const tal_t *ctx, const u8 *bytes,
719 size_t byte_len)

Callers 4

towire_wally_psbtFunction · 0.85
linearize_inputFunction · 0.85
linearize_outputFunction · 0.85
db_bind_psbtFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected