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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-03-23 16:18:09 +10:30
parent 7e592f27d4
commit e51f629e34

View File

@@ -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);