From cec87ba08b81b4df17af03217d2c01fc5d1c7de2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 15 Dec 2017 20:52:57 +1030 Subject: [PATCH] peer_control: move link to the top of the structure. memleak doesn't detect pointers to within an object, only pointers to their exact address (it's simpler this way). Moving the linked list to the top of the structure means it can follow the chain. Signed-off-by: Rusty Russell --- lightningd/peer_control.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index aee2378a9..25e6276b5 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -18,6 +18,10 @@ struct crypto_state; struct peer { + /* Inside ld->peers. */ + struct list_node list; + + /* Master context */ struct lightningd *ld; /* Database ID of the peer */ @@ -41,9 +45,6 @@ struct peer { /* Command which ordered us to open channel, if any. */ struct command *opening_cmd; - /* Inside ld->peers. */ - struct list_node list; - /* Is there a single subdaemon responsible for us? */ struct subd *owner;