1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-09-03 09:42:17 +00:00

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.

This commit is contained in:
Con Kolivas 2012-11-18 16:38:24 +11:00
parent 1470eea903
commit 52b86b5137

View File

@ -3579,7 +3579,7 @@ static bool test_work_current(struct work *work)
if (unlikely(new_blocks == 1)) if (unlikely(new_blocks == 1))
goto out_free; goto out_free;
work_block++; work->work_block = ++work_block;
if (!work->stratum) { if (!work->stratum) {
if (work->longpoll) { if (work->longpoll) {
@ -3592,10 +3592,10 @@ static bool test_work_current(struct work *work)
} }
restart_threads(); restart_threads();
} else if (work->longpoll) { } else if (work->longpoll) {
work->work_block = ++work_block;
if (work->pool == current_pool()) { if (work->pool == current_pool()) {
applog(LOG_NOTICE, "%sLONGPOLL from pool %d requested work restart", applog(LOG_NOTICE, "%sLONGPOLL from pool %d requested work restart",
work->gbt ? "GBT " : "", work->pool->pool_no); work->gbt ? "GBT " : "", work->pool->pool_no);
work_block++;
restart_threads(); restart_threads();
} }
} }