Skip to content

Commit

Permalink
topo: Do not keep txids in memory indefinitely
Browse files Browse the repository at this point in the history
I mistakenly assumed the block would be freed after processing completed. That
is not true since chaintopology keeps headers and stubs around for reorgs. So
we need to remove the precomputed txids along with the full_txs.
  • Loading branch information
cdecker authored and rustyrussell committed Sep 23, 2020
1 parent 20a2476 commit d17a3c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lightningd/chaintopology.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static void filter_block_txs(struct chain_topology *topo, struct block *b)
txwatch_inform(topo, &txid, tx);
}
b->full_txs = tal_free(b->full_txs);
b->txids = tal_free(b->txids);
}

size_t get_tx_depth(const struct chain_topology *topo,
Expand Down

0 comments on commit d17a3c5

Please sign in to comment.