Browse Source

lightningd/gossip: shut down daemon when status fd closed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
3509f10e30
  1. 6
      lightningd/gossip/gossip.c

6
lightningd/gossip/gossip.c

@ -608,6 +608,10 @@ int main(int argc, char *argv[])
/* stdin == control */
daemon_conn_init(daemon, &daemon->master, STDIN_FILENO, recv_req);
status_setup_async(&daemon->master);
/* When conn closes, everything is freed. */
tal_steal(daemon->master.conn, daemon);
for (;;) {
struct timer *expired = NULL;
io_loop(&daemon->timers, &expired);
@ -618,8 +622,6 @@ int main(int argc, char *argv[])
timer_expired(daemon, expired);
}
}
tal_free(daemon);
return 0;
}
#endif

Loading…
Cancel
Save