From 52b86b513798a44d15c4dad21f1ad9380f12aec0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 18 Nov 2012 16:38:24 +1100 Subject: [PATCH] Update work block on the longpoll work item before calling restart threads to ensure all work but the longpoll work item gets discarded when we call discard_stale from restart_threads. --- cgminer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 07d99ee2..6129301e 100644 --- a/cgminer.c +++ b/cgminer.c @@ -3579,7 +3579,7 @@ static bool test_work_current(struct work *work) if (unlikely(new_blocks == 1)) goto out_free; - work_block++; + work->work_block = ++work_block; if (!work->stratum) { if (work->longpoll) { @@ -3592,10 +3592,10 @@ static bool test_work_current(struct work *work) } restart_threads(); } else if (work->longpoll) { + work->work_block = ++work_block; if (work->pool == current_pool()) { applog(LOG_NOTICE, "%sLONGPOLL from pool %d requested work restart", work->gbt ? "GBT " : "", work->pool->pool_no); - work_block++; restart_threads(); } }