Browse Source

pull_bitcoin_tx: allocate outputs off tx itself.

All the members of the transaction should be allocated off the
transaction, as they have the same lifetime.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 9 years ago
parent
commit
7cf786f1f4
  1. 2
      bitcoin/tx.c

2
bitcoin/tx.c

@ -421,7 +421,7 @@ static struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx,
tx->fee = pull_le64(cursor, max);
tx->output_count = pull_varint(cursor, max);
tx->output = tal_arr(ctx, struct bitcoin_tx_output, tx->output_count);
tx->output = tal_arr(tx, struct bitcoin_tx_output, tx->output_count);
for (i = 0; i < tx->output_count; i++)
pull_output(tx, cursor, max, tx->output + i);
tx->lock_time = pull_le32(cursor, max);

Loading…
Cancel
Save