| 663 | } |
| 664 | |
| 665 | struct wally_psbt *psbt_from_b64(const tal_t *ctx, |
| 666 | const char *b64, |
| 667 | size_t b64len) |
| 668 | { |
| 669 | struct wally_psbt *psbt; |
| 670 | char *str = tal_strndup(tmpctx, b64, b64len); |
| 671 | |
| 672 | tal_wally_start(); |
| 673 | if (wally_psbt_from_base64(str, &psbt) == WALLY_OK) |
| 674 | tal_add_destructor(psbt, psbt_destroy); |
| 675 | else |
| 676 | psbt = NULL; |
| 677 | tal_wally_end_onto(ctx, psbt, struct wally_psbt); |
| 678 | |
| 679 | return psbt; |
| 680 | } |
| 681 | |
| 682 | char *psbt_to_b64(const tal_t *ctx, const struct wally_psbt *psbt) |
| 683 | { |