From e51f629e349d69dfe0a1f913c4c1f526dcd86d40 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Mar 2023 16:18:09 +1030 Subject: [PATCH] bitcoind: fix clone_bitcoin_tx() when tx is take(). We need to actually steal it onto requested context in this case! Signed-off-by: Rusty Russell --- bitcoin/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index 37d2a9a61..d6fcd6c08 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -597,7 +597,7 @@ struct bitcoin_tx *clone_bitcoin_tx(const tal_t *ctx, struct bitcoin_tx *newtx; if (taken(tx)) - return cast_const(struct bitcoin_tx *, tx); + return cast_const(struct bitcoin_tx *, tal_steal(ctx, tx)); newtx = tal(ctx, struct bitcoin_tx);