1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Generate a gbt work item from longpoll when required to set new block and message appropriately.

This commit is contained in:
Con Kolivas 2012-11-05 17:57:33 +11:00
parent 10ea5fbf97
commit 1321cb0e0d

View File

@ -5598,15 +5598,18 @@ static void convert_to_work(json_t *val, int rolltime, struct pool *pool, struct
}
work->pool = pool;
work->rolltime = rolltime;
work->longpoll = true;
memcpy(&(work->tv_getwork), tv_lp, sizeof(struct timeval));
memcpy(&(work->tv_getwork_reply), tv_lp_reply, sizeof(struct timeval));
work->getwork_mode = GETWORK_MODE_LP;
calc_diff(work, 0);
if (pool->enabled == POOL_REJECTING)
work->mandatory = true;
if (pool->has_gbt)
gen_gbt_work(pool, work);
work->longpoll = true;
work->getwork_mode = GETWORK_MODE_LP;
/* We'll be checking this work item twice, but we already know it's
* from a new block so explicitly force the new block detection now
* rather than waiting for it to hit the stage thread. This also