From 23a1d7d475265bfc99ff0ca48581732f7f23c2f5 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sat, 18 Mar 2017 19:59:18 +0100 Subject: [PATCH] gossip: Do not log anything, it breaks a daemon connection! This came up while debugging the gossip daemon breaking upon calling `getroute`. It turns out that log was still writing to stdout, but stdout had been reused for an inter-daemon socket, which would break... --- lightningd/gossip/gossip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightningd/gossip/gossip.c b/lightningd/gossip/gossip.c index 51281d9ce..3b3ce5aed 100644 --- a/lightningd/gossip/gossip.c +++ b/lightningd/gossip/gossip.c @@ -529,7 +529,9 @@ int main(int argc, char *argv[]) SECP256K1_CONTEXT_SIGN); daemon = tal(NULL, struct daemon); - log_book = new_log_book(daemon, 2 * 1024 * 1024, LOG_INFORM); + /* Do not log absolutely anything, stdout is now a socket + * connected to some other daemon. */ + log_book = new_log_book(daemon, 2 * 1024 * 1024, LOG_BROKEN + 1); base_log = new_log(daemon, log_book, "lightningd_gossip(%u):", (int)getpid()); daemon->rstate = new_routing_state(daemon, base_log);