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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-02-26 11:20:33 +10:30
parent a901402e66
commit 899f54894f

View File

@@ -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;