From 899f54894fcb5810f004a33160e4901fce5c8d20 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 26 Feb 2022 11:20:33 +1030 Subject: [PATCH] gossipd: move deferred_update list ptr to head to ease memleak checks. They can only follow pointers (without help) if they point to the *start* of a tal object. Signed-off-by: Rusty Russell --- gossipd/gossip_generation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gossipd/gossip_generation.c b/gossipd/gossip_generation.c index d641063ac..eb25ce880 100644 --- a/gossipd/gossip_generation.c +++ b/gossipd/gossip_generation.c @@ -536,9 +536,11 @@ static void sign_timestamp_and_apply_update(struct daemon *daemon, /* We don't want to thrash the gossip network, so we often defer sending an * update. We track them here. */ struct deferred_update { - struct daemon *daemon; - /* Off daemon->deferred_updates */ + /* Off daemon->deferred_updates (our leak detection needs this as + * first element in struct, because it's dumb!) */ struct list_node list; + /* The daemon */ + struct daemon *daemon; /* Channel it's for (and owner) */ const struct chan *chan; int direction;