From 2673b3aeff98ef37f1f0c450788d6665b444e736 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 26 Oct 2015 09:13:59 +0100 Subject: [PATCH] stratum: hide timeout warnings while waiting this timeout is not important, we reconnect after --- ccminer.cpp | 6 +++++- util.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index b670e76..3ae49bb 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -149,6 +149,7 @@ struct pool_infos pools[MAX_POOLS] = { 0 }; int num_pools = 1; volatile int cur_pooln = 0; bool opt_pool_failover = true; +volatile bool pool_on_hold = false; volatile bool pool_is_switching = false; volatile int pool_switch_count = 0; bool conditional_pool_rotate = false; @@ -1644,10 +1645,12 @@ static void *miner_thread(void *userdata) continue; } + pool_on_hold = true; sleep(5); if (!thr_id) pools[cur_pooln].wait_time += 5; continue; } + pool_on_hold = false; work_restart[thr_id].restart = 0; @@ -2294,7 +2297,8 @@ wait_stratum_url: if (!s) { stratum_disconnect(&stratum); - applog(LOG_WARNING, "Stratum connection interrupted"); + if (!opt_quiet && !pool_on_hold) + applog(LOG_WARNING, "Stratum connection interrupted"); continue; } if (!stratum_handle_method(&stratum, s)) diff --git a/util.cpp b/util.cpp index 97e4b28..9bba3bd 100644 --- a/util.cpp +++ b/util.cpp @@ -988,7 +988,7 @@ char *stratum_recv_line(struct stratum_ctx *sctx) } while (time(NULL) - rstart < timeout && !strstr(sctx->sockbuf, "\n")); if (!ret) { - applog(LOG_ERR, "stratum_recv_line failed"); + if (opt_debug) applog(LOG_ERR, "stratum_recv_line failed"); goto out; } }