lightningd: use a hash table for peer->dbid.

Otherwise, loading up when we have 100k peers is *painful*!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-18 15:34:32 +10:30
committed by Alex Myers
parent cfa632b0e9
commit 0e25d56329
7 changed files with 47 additions and 13 deletions

View File

@@ -156,6 +156,7 @@ static void finish_report(const struct leak_detect *leaks)
memleak_scan_htable(memtable, &ld->htlcs_out->raw);
memleak_scan_htable(memtable, &ld->htlc_sets->raw);
memleak_scan_htable(memtable, &ld->peers->raw);
memleak_scan_htable(memtable, &ld->peers_by_dbid->raw);
/* Now delete ld and those which it has pointers to. */
memleak_scan_obj(memtable, ld);