Skip to content

Commit

Permalink
check_block: free up proofs when we add txhash.
Browse files Browse the repository at this point in the history
We previously did it only when we add a full tx, but adding a txhash
also means we don't need the proof any more (once we have them all).

Otherwise check_block_shard() asserts after we recv_shard.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Sep 16, 2014
1 parent f95349d commit ffedf26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions check_block.c
Expand Up @@ -287,6 +287,10 @@ bool put_txhash_in_shard(struct state *state,
add_txhash_to_hashes(state, shard, block, shardnum, txoff,
&txrefhash->txhash);

/* If we've just filled it, we don't need proofs any more. */
if (shard_all_hashes(shard))
shard->proof = tal_free(shard->proof);

/* This could eliminate a pending tx. */
state->pending->needs_recheck = true;

Expand Down

0 comments on commit ffedf26

Please sign in to comment.