mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossipd: minor modifications for memleak detection to work.
1. Move the list to the start of `struct peer`: memleak walks the list correctly this way. 2. Don't create tal parent loop daemon->conn->daemon. The second one is silly anyway: we exit via master_gone when the master conn is closed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a2828ed40b
commit
2db77f5d1d
@ -119,11 +119,11 @@ struct daemon {
|
||||
};
|
||||
|
||||
struct peer {
|
||||
struct daemon *daemon;
|
||||
|
||||
/* daemon->peers */
|
||||
struct list_node list;
|
||||
|
||||
struct daemon *daemon;
|
||||
|
||||
/* The ID of the peer (not necessarily unique, in transit!) */
|
||||
struct pubkey id;
|
||||
|
||||
@ -2261,9 +2261,6 @@ int main(int argc, char *argv[])
|
||||
daemon_conn_init(daemon, &daemon->connectd, CONNECTD_FD, connectd_req,
|
||||
NULL);
|
||||
|
||||
/* When conn closes, everything is freed. */
|
||||
tal_steal(daemon->master.conn, daemon);
|
||||
|
||||
for (;;) {
|
||||
struct timer *expired = NULL;
|
||||
io_loop(&daemon->timers, &expired);
|
||||
|
@ -48,10 +48,6 @@ void command_fail_detailed(struct command *cmd, int code,
|
||||
/* Generated stub for fmt_wireaddr_without_port */
|
||||
char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED)
|
||||
{ fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); }
|
||||
/* Generated stub for json_tok_wtx */
|
||||
bool json_tok_wtx(struct wallet_tx * tx UNNEEDED, const char * buffer UNNEEDED,
|
||||
const jsmntok_t * sattok UNNEEDED, u64 max UNNEEDED)
|
||||
{ fprintf(stderr, "json_tok_wtx called!\n"); abort(); }
|
||||
/* AUTOGENERATED MOCKS END */
|
||||
|
||||
struct json {
|
||||
|
Loading…
Reference in New Issue
Block a user