lightningd: speed mapping from coinmoves table to channel for listcoinmoves.

Iterating through every peer and channel every time can be very slow
for large nodes, when calling wallet_coinmoves_extract for listcoinmoves.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-08-19 10:30:45 +09:30
parent f7e9af23c1
commit 233628ad48
6 changed files with 55 additions and 15 deletions

View File

@@ -218,6 +218,9 @@ struct lightningd {
/* Here are all our channels and their aliases */
struct channel_scid_map *channels_by_scid;
/* Open channels by dbid */
struct channel_dbid_map *channels_by_dbid;
/* Outstanding connect commands. */
struct list_head connects;