Skip to content

Commit 0d854ba

Browse files
jgriffithsrustyrussell
authored andcommitted
psbt: avoid duplicating the input string when parsing from base64
Changelog-None Signed-off-by: Jon Griffiths <[email protected]>
1 parent 960a441 commit 0d854ba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bitcoin/psbt.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,9 @@ struct wally_psbt *psbt_from_b64(const tal_t *ctx,
761761
size_t b64len)
762762
{
763763
struct wally_psbt *psbt;
764-
char *str = tal_strndup(tmpctx, b64, b64len);
765764

766765
tal_wally_start();
767-
if (wally_psbt_from_base64(str, /* flags */ 0, &psbt) == WALLY_OK)
766+
if (wally_psbt_from_base64_n(b64, b64len, /* flags */ 0, &psbt) == WALLY_OK)
768767
tal_add_destructor(psbt, psbt_destroy);
769768
else
770769
psbt = NULL;

0 commit comments

Comments
 (0)