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

Queue extra work at 2/3 differently depending on whether we're using nonce range or not.

This commit is contained in:
Con Kolivas 2012-07-04 23:57:54 +10:00
parent 6314a12b31
commit 8766bca4d4

View File

@ -425,6 +425,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
bitforce->wait_ms = 0;
ret = bitforce_send_work(thr, work);
if (!bitforce->nonce_range) {
/* Initially wait 2/3 of the average cycle time so we can request more
work before full scan is up */
sleep_time = (2 * bitforce->sleep_ms) / 3;
@ -442,6 +443,15 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
return 1;
bitforce->wait_ms += sleep_time;
} else {
sleep_time = bitforce->sleep_ms;
ms_to_timeval(sleep_time, &tdiff);
if (!restart_wait(&tdiff))
return 1;
/* queue extra request once more than 2/3 is done */
if (work->blk.nonce > 0xffffffff / 3 * 2)
queue_request(thr, false);
}
if (ret)
ret = bitforce_get_result(thr, work);