From b8ba8f003c6f4e6e816a4ebc3b8b7ad005ee6dd8 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 18 May 2017 13:31:34 +0200 Subject: [PATCH] logging: Removed automatic subprocess logging for bitcoind This was responsible for a huge number of loglines simply because we log every subprocess start and termination. Moving the logging upstream to where it is really needed gets rid of the polling, that are successful. A highly unscientific test shows a reduction in loglines produced by lightningd from 17000 to 10000 lines. --- daemon/bitcoind.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/daemon/bitcoind.c b/daemon/bitcoind.c index cbb798e3b..0c3d74222 100644 --- a/daemon/bitcoind.c +++ b/daemon/bitcoind.c @@ -131,7 +131,6 @@ static void bcli_finished(struct io_conn *conn, struct bitcoin_cli *bcli) } else *bcli->exitstatus = WEXITSTATUS(status); - log_debug(bitcoind->log, "reaped %u: %s", ret, bcli_args(bcli)); bitcoind->req_running = false; bcli->process(bcli); @@ -150,8 +149,6 @@ static void next_bcli(struct bitcoind *bitcoind) if (!bcli) return; - log_debug(bcli->bitcoind->log, "starting: %s", bcli_args(bcli)); - bcli->pid = pipecmdarr(&bcli->fd, NULL, &bcli->fd, bcli->args); if (bcli->pid < 0) fatal("%s exec failed: %s", bcli->args[0], strerror(errno)); @@ -296,6 +293,7 @@ void bitcoind_sendrawtx_(struct peer *peer, int exitstatus, const char *msg, void *), void *arg) { + log_debug(bitcoind->log, "sendrawtransaction: %s", hextx); start_bitcoin_cli(bitcoind, NULL, process_sendrawtx, true, cb, arg, "sendrawtransaction", hextx, NULL); } @@ -310,8 +308,6 @@ static void process_chaintips(struct bitcoin_cli *bcli) struct sha256_double *tipid, void *arg) = bcli->cb; - log_debug(bcli->bitcoind->log, "Got getchaintips result"); - tokens = json_parse_input(bcli->output, bcli->output_bytes, &valid); if (!tokens) fatal("%s: %s response",