1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-30 16:34:23 +00:00

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.
This commit is contained in:
Noel Maersk 2014-04-02 23:35:03 +03:00
parent 4c64a192f7
commit cabb02f5d4
2 changed files with 2 additions and 3 deletions

View File

@ -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;

4
util.c
View File

@ -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);