From 4757c965e0a4d49d0ebd32456c11a7dbb8ba01ba Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Mar 2023 16:16:52 +1030 Subject: [PATCH] lightningd: don't use notleak in chaintopology.c We can add the htable to the memleak detection, and we already do this for the watches. Signed-off-by: Rusty Russell --- lightningd/chaintopology.c | 9 ++++----- lightningd/memdump.c | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index d1035ee5c..12f44dd3c 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -224,7 +223,7 @@ static void broadcast_done(struct bitcoind *bitcoind, } else { /* For continual rebroadcasting, until channel freed. */ tal_steal(otx->channel, otx); - outgoing_tx_map_add(bitcoind->ld->topology->outgoing_txs, notleak(otx)); + outgoing_tx_map_add(bitcoind->ld->topology->outgoing_txs, otx); tal_add_destructor2(otx, destroy_outgoing_tx, bitcoind->ld->topology); } } @@ -324,9 +323,9 @@ static void watch_for_utxo_reconfirmation(struct chain_topology *topo, if (find_txwatch(topo, &unconfirmed[i]->outpoint.txid, NULL)) continue; - notleak(watch_txid(topo, topo, NULL, - &unconfirmed[i]->outpoint.txid, - closeinfo_txid_confirmed)); + watch_txid(topo, topo, NULL, + &unconfirmed[i]->outpoint.txid, + closeinfo_txid_confirmed); } } diff --git a/lightningd/memdump.c b/lightningd/memdump.c index 64cfa6bec..dcca47368 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -152,6 +152,7 @@ static void finish_report(const struct leak_detect *leaks) /* First delete known false positives. */ memleak_scan_htable(memtable, &ld->topology->txwatches->raw); memleak_scan_htable(memtable, &ld->topology->txowatches->raw); + memleak_scan_htable(memtable, &ld->topology->outgoing_txs->raw); memleak_scan_htable(memtable, &ld->htlcs_in->raw); memleak_scan_htable(memtable, &ld->htlcs_out->raw); memleak_scan_htable(memtable, &ld->htlc_sets->raw);