From f80176eae94ffdb71fd9e0a16f19b0ca3376d71e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 24 Aug 2018 16:27:14 +0930 Subject: [PATCH] connectd: move list entries of structs to top, to help dev-memleak detection. We sweep looking for pointers to tal objects; we don't look for pointers inside them. Thus lists only work transparently if they're at the head of the object; so far this has been sufficient. Signed-off-by: Rusty Russell --- connectd/connect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connectd/connect.c b/connectd/connect.c index ef94128be..b78e2ecf2 100644 --- a/connectd/connect.c +++ b/connectd/connect.c @@ -133,11 +133,11 @@ struct daemon { /* Peers we're trying to reach. */ struct reaching { - struct daemon *daemon; - /* daemon->reaching */ struct list_node list; + struct daemon *daemon; + /* The ID of the peer (not necessarily unique, in transit!) */ struct pubkey id; @@ -161,11 +161,11 @@ struct reaching { /* This is a transitory structure: we hand off to the master daemon as soon * as we've completed INIT read/write. */ struct peer { - struct daemon *daemon; - /* For reconnecting peers, this is in daemon->reconnecting. */ struct list_node list; + struct daemon *daemon; + /* The ID of the peer */ struct pubkey id;