From cdb5de0bceeeca4416c75f7d583236d664637271 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Tue, 9 Jan 2024 20:42:03 +1300 Subject: [PATCH] fromwire_bitcoin_tx: avoid creating a PSBT wrapper just to throw it away again Changelog-None Signed-off-by: Jon Griffiths --- bitcoin/tx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index e9c58c049..d86b53c94 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -794,15 +794,13 @@ struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, u32 len = fromwire_u32(cursor, max); size_t start = *max; - tx = pull_bitcoin_tx(ctx, cursor, max); + tx = pull_bitcoin_tx_only(ctx, cursor, max); if (!tx) return fromwire_fail(cursor, max); // Check that we consumed len bytes if (start - *max != len) return fromwire_fail(cursor, max); - /* pull_bitcoin_tx sets the psbt */ - tal_free(tx->psbt); tx->psbt = fromwire_wally_psbt(tx, cursor, max); if (!tx->psbt) return fromwire_fail(cursor, max);