From 1cb527d46a45917b7337322bfcc1c6426cb43131 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 23 Sep 2020 11:07:04 +0930 Subject: [PATCH] topo: Do not keep txids in memory indefinitely 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. --- lightningd/chaintopology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 4c16f72c5..7c4bdc11c 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -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,