Skip to content

Commit

Permalink
pull_bitcoin_tx: allocate outputs off tx itself.
Browse files Browse the repository at this point in the history
All the members of the transaction should be allocated off the
transaction, as they have the same lifetime.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jan 21, 2016
1 parent 3a803ee commit 7cf786f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bitcoin/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7cf786f

Please sign in to comment.