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

Function psbt_get_bytes

bitcoin/psbt.c:897–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897const u8 *psbt_get_bytes(const tal_t *ctx, const struct wally_psbt *psbt,
898 size_t *bytes_written)
899{
900 size_t len = 0;
901 u8 *bytes;
902
903 if (!psbt) {
904 *bytes_written = 0;
905 return NULL;
906 }
907
908 if (wally_psbt_get_length(psbt, 0, &len) != WALLY_OK) {
909 abort();
910 }
911 bytes = tal_arr(ctx, u8, len);
912
913 if (wally_psbt_to_bytes(psbt, 0, bytes, len, bytes_written) != WALLY_OK ||
914 *bytes_written != len) {
915 /* something went wrong. bad libwally ?? */
916 abort();
917 }
918 return bytes;
919}
920
921bool validate_psbt(const struct wally_psbt *psbt)
922{

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