mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
lightningd/gossip: shut down daemon when status fd closed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -608,6 +608,10 @@ int main(int argc, char *argv[])
|
|||||||
/* stdin == control */
|
/* stdin == control */
|
||||||
daemon_conn_init(daemon, &daemon->master, STDIN_FILENO, recv_req);
|
daemon_conn_init(daemon, &daemon->master, STDIN_FILENO, recv_req);
|
||||||
status_setup_async(&daemon->master);
|
status_setup_async(&daemon->master);
|
||||||
|
|
||||||
|
/* When conn closes, everything is freed. */
|
||||||
|
tal_steal(daemon->master.conn, daemon);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
struct timer *expired = NULL;
|
struct timer *expired = NULL;
|
||||||
io_loop(&daemon->timers, &expired);
|
io_loop(&daemon->timers, &expired);
|
||||||
@@ -618,8 +622,6 @@ int main(int argc, char *argv[])
|
|||||||
timer_expired(daemon, expired);
|
timer_expired(daemon, expired);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tal_free(daemon);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user