From 85210ee7a897d8132011881cc721cf33668287d0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 31 May 2012 08:41:56 +1000 Subject: [PATCH] If shares are known stale, don't use them to decide to disable a pool for sequential rejects. --- cgminer.c | 7 +++++-- miner.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 118747b6..2373cae6 100644 --- a/cgminer.c +++ b/cgminer.c @@ -1725,8 +1725,10 @@ static bool submit_upstream_work(const struct work *work, CURL *curl) /* Once we have more than a nominal amount of sequential rejects, * at least 10 and more than 3 mins at the current utility, * disable the pool because some pool error is likely to have - * ensued. */ - if (pool->seq_rejects > 10 && opt_disable_pool && total_pools > 1) { + * ensued. Do not do this if we know the share just happened to + * be stale due to networking delays. + */ + if (pool->seq_rejects > 10 && !work->stale && opt_disable_pool && total_pools > 1) { double utility = total_accepted / ( total_secs ? total_secs : 1 ) * 60; if (pool->seq_rejects > utility * 3) { @@ -2161,6 +2163,7 @@ static void *submit_work_thread(void *userdata) pool->stale_shares++; goto out; } + work->stale = true; } ce = pop_curl_entry(pool); diff --git a/miner.h b/miner.h index 186eb9f8..a9adafee 100644 --- a/miner.h +++ b/miner.h @@ -716,11 +716,13 @@ struct work { int thr_id; struct pool *pool; struct timeval tv_staged; + bool mined; bool clone; bool cloned; bool rolltime; bool longpoll; + bool stale; unsigned int work_block; int id;