1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 10:04:33 +00:00

Only do local generation of work if existing work is not stale.

This commit is contained in:
Con Kolivas 2011-07-16 00:52:57 +10:00
parent 4a94199246
commit 77b0f946f6

4
main.c
View File

@ -1258,7 +1258,7 @@ retry:
goto out; goto out;
} }
if (!requests_staged()) { if (!requests_staged() && !stale_work(work)) {
uint32_t *work_ntime; uint32_t *work_ntime;
uint32_t ntime; uint32_t ntime;
@ -1283,6 +1283,7 @@ retry:
goto retry; goto retry;
} }
} }
work_ntime = (uint32_t *)(work->data + 68); work_ntime = (uint32_t *)(work->data + 68);
ntime = be32toh(*work_ntime); ntime = be32toh(*work_ntime);
ntime++; ntime++;
@ -1291,6 +1292,7 @@ retry:
local_work++; local_work++;
goto out; goto out;
} }
/* wait for 1st response, or get cached response */ /* wait for 1st response, or get cached response */
work_heap = tq_pop(thr->q, NULL); work_heap = tq_pop(thr->q, NULL);
if (unlikely(!work_heap)) { if (unlikely(!work_heap)) {