From adda6e6680a9808145da84df7953a0ed9d4f9bed Mon Sep 17 00:00:00 2001 From: ckolivas Date: Tue, 1 May 2012 17:48:23 +1000 Subject: [PATCH] Do not recruit extra connection threads if there have been connection errors to the pool in question. --- cgminer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cgminer.c b/cgminer.c index 28dd38b0..dba807a4 100644 --- a/cgminer.c +++ b/cgminer.c @@ -2080,7 +2080,7 @@ static bool workio_get_work(struct workio_cmd *wc) struct pool *pool = select_pool(wc->lagging); pthread_t get_thread; - if (list_empty(&pool->getwork_q->q)) + if (list_empty(&pool->getwork_q->q) || pool->submit_fail) return tq_push(pool->getwork_q, wc); if (unlikely(pthread_create(&get_thread, NULL, get_extra_work, (void *)wc))) { @@ -2242,10 +2242,11 @@ out: * any size hardware */ static bool workio_submit_work(struct workio_cmd *wc) { + struct pool *pool = wc->u.work->pool; pthread_t submit_thread; - if (list_empty(&wc->u.work->pool->submit_q->q)) - return tq_push(wc->u.work->pool->submit_q, wc); + if (list_empty(&pool->submit_q->q) || pool->submit_fail) + return tq_push(pool->submit_q, wc); if (unlikely(pthread_create(&submit_thread, NULL, submit_extra_work, (void *)wc))) { applog(LOG_ERR, "Failed to create submit_work_thread");