From e93f679ae4f0a1320a3a68d20b07f43b34f1a7bf Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 30 Sep 2012 23:44:27 +1000 Subject: [PATCH] Use the current pool when deciding whether to reuse work from a stratum source rather than the work's previous pool. --- cgminer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cgminer.c b/cgminer.c index 5751e1f3..65ea5d43 100644 --- a/cgminer.c +++ b/cgminer.c @@ -4370,11 +4370,11 @@ static struct work *hash_pop(const struct timespec *abstime) return work; } -static bool reuse_work(struct work *work) +static bool reuse_work(struct work *work, struct pool *pool) { - if (work->stratum && !work->pool->idle) { + if (pool->has_stratum) { applog(LOG_DEBUG, "Reusing stratum work"); - gen_stratum_work(work->pool, work);; + gen_stratum_work(pool, work);; return true; } @@ -4545,7 +4545,7 @@ static void get_work(struct work *work, struct thr_info *thr, const int thr_id) retry: pool = current_pool(); - if (reuse_work(work)) + if (reuse_work(work, pool)) goto out; if (!pool->lagging && !total_staged() && global_queued() >= mining_threads + opt_queue) {