From cabb02f5d4df8b2777fecf7eb3e9557601917597 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Wed, 2 Apr 2014 23:35:03 +0300 Subject: [PATCH] log: do not show pool difficulty changes on non-current pool. Keep log spam down when using a lot of vardiff pools, or if a p2pool is a fallback. --- logging.c | 1 - util.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/logging.c b/logging.c index a511786b..35635ce2 100644 --- a/logging.c +++ b/logging.c @@ -48,7 +48,6 @@ static void my_log_curses(int prio, const char *datetime, const char *str, bool } /* high-level logging function, based on global opt_log_level */ - void applog(int prio, const char* fmt, ...) { va_list args; diff --git a/util.c b/util.c index 3972b2eb..fcc7dc74 100644 --- a/util.c +++ b/util.c @@ -1655,9 +1655,9 @@ static bool parse_diff(struct pool *pool, json_t *val) int idiff = diff; if ((double)idiff == diff) - applog(LOG_NOTICE, "%s difficulty changed to %d", get_pool_name(pool), idiff); + applog(pool == current_pool() ? LOG_NOTICE : LOG_DEBUG, "%s difficulty changed to %d", get_pool_name(pool), idiff); else - applog(LOG_NOTICE, "%s difficulty changed to %.1f", get_pool_name(pool), diff); + applog(pool == current_pool() ? LOG_NOTICE : LOG_DEBUG, "%s difficulty changed to %.1f", get_pool_name(pool), diff); } else applog(LOG_DEBUG, "%s difficulty set to %f", pool->name, diff);