1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-10 12:41:02 +00:00

Check we haven't staged work while waiting for a curl entry before proceeding.

This commit is contained in:
Con Kolivas 2012-08-23 11:09:09 +10:00
parent 86d5377e72
commit b74b54d95b

View File

@ -2421,13 +2421,18 @@ retry:
lagging = true; lagging = true;
pool = ret_work->pool = select_pool(lagging); pool = ret_work->pool = select_pool(lagging);
inc_queued();
if (!ce) if (!ce)
ce = pop_curl_entry(pool); ce = pop_curl_entry(pool);
/* Inc queued count after ce is popped in case there're none /* Check that we haven't staged work via other threads while
* left and we think we've queued work when we're just waiting * waiting for a curl entry */
* for curls */ if (total_staged() >= maxq) {
inc_queued(); dec_queued();
free_work(ret_work);
goto out;
}
/* obtain new work from bitcoin via JSON-RPC */ /* obtain new work from bitcoin via JSON-RPC */
if (!get_upstream_work(ret_work, ce->curl)) { if (!get_upstream_work(ret_work, ce->curl)) {