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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-12-15 20:52:57 +10:30 committed by Christian Decker
parent 20fcb5d6ef
commit cec87ba08b

View File

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