mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Limit rolltime work generation to 10 iterations only.
This commit is contained in:
parent
6e9b6bf840
commit
ec86da70e1
8
main.c
8
main.c
@ -2034,6 +2034,11 @@ static void flush_requests(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool can_roll(struct work *work)
|
||||||
|
{
|
||||||
|
return (!stale_work(work) && work->pool->has_rolltime && work->rolls < 11);
|
||||||
|
}
|
||||||
|
|
||||||
static bool get_work(struct work *work, bool queued, struct thr_info *thr,
|
static bool get_work(struct work *work, bool queued, struct thr_info *thr,
|
||||||
const int thr_id)
|
const int thr_id)
|
||||||
{
|
{
|
||||||
@ -2054,7 +2059,7 @@ retry:
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!requests_staged() && !stale_work(work) && work->pool->has_rolltime) {
|
if (!requests_staged() && can_roll(work)) {
|
||||||
uint32_t *work_ntime;
|
uint32_t *work_ntime;
|
||||||
uint32_t ntime;
|
uint32_t ntime;
|
||||||
|
|
||||||
@ -2084,6 +2089,7 @@ retry:
|
|||||||
*work_ntime = htobe32(ntime);
|
*work_ntime = htobe32(ntime);
|
||||||
ret = true;
|
ret = true;
|
||||||
local_work++;
|
local_work++;
|
||||||
|
work->rolls++;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
miner.h
3
miner.h
@ -293,9 +293,10 @@ struct work {
|
|||||||
unsigned char hash1[64];
|
unsigned char hash1[64];
|
||||||
unsigned char midstate[32];
|
unsigned char midstate[32];
|
||||||
unsigned char target[32];
|
unsigned char target[32];
|
||||||
|
|
||||||
unsigned char hash[32];
|
unsigned char hash[32];
|
||||||
|
|
||||||
|
int rolls;
|
||||||
|
|
||||||
uint32_t output[1];
|
uint32_t output[1];
|
||||||
uint32_t res_nonce;
|
uint32_t res_nonce;
|
||||||
uint32_t valid;
|
uint32_t valid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user