Browse Source

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.
refactor
Noel Maersk 11 years ago
parent
commit
cabb02f5d4
  1. 1
      logging.c
  2. 4
      util.c

1
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 */ /* high-level logging function, based on global opt_log_level */
void applog(int prio, const char* fmt, ...) { void applog(int prio, const char* fmt, ...) {
va_list args; va_list args;

4
util.c

@ -1655,9 +1655,9 @@ static bool parse_diff(struct pool *pool, json_t *val)
int idiff = diff; int idiff = diff;
if ((double)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 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 } else
applog(LOG_DEBUG, "%s difficulty set to %f", pool->name, diff); applog(LOG_DEBUG, "%s difficulty set to %f", pool->name, diff);

Loading…
Cancel
Save