From 5d1b944a21a87ce5dee19488f7527bd16fdd120f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Aug 2018 21:35:20 +0930 Subject: [PATCH] hsmd: use async for status reporting. We can otherwise deadlock against lightningd which also talks to us sync. Fixes: #1759 Signed-off-by: Rusty Russell --- hsmd/hsm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hsmd/hsm.c b/hsmd/hsm.c index 4f51e0ebf..477b5696b 100644 --- a/hsmd/hsm.c +++ b/hsmd/hsm.c @@ -1441,9 +1441,14 @@ int main(int argc, char *argv[]) setup_locale(); struct client *client; + struct daemon_conn *status_conn = tal(NULL, struct daemon_conn); subdaemon_setup(argc, argv); - status_setup_sync(STDIN_FILENO); + + /* A trivial daemon_conn just for writing. */ + daemon_conn_init(status_conn, status_conn, STDIN_FILENO, + (void *)io_never, NULL); + status_setup_async(status_conn); client = new_client(NULL, NULL, 0, HSM_CAP_MASTER | HSM_CAP_SIGN_GOSSIP, handle_client, REQ_FD);