mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
Style changes.
This commit is contained in:
parent
bc0b14063f
commit
af809b79be
11
cgminer.c
11
cgminer.c
@ -4146,22 +4146,21 @@ void *miner_thread(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely((long)sdiff.tv_sec < cycle)) {
|
if (unlikely((long)sdiff.tv_sec < cycle)) {
|
||||||
|
int mult;
|
||||||
|
|
||||||
if (likely(!api->can_limit_work || max_nonce == 0xffffffff))
|
if (likely(!api->can_limit_work || max_nonce == 0xffffffff))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
{
|
mult = 1000000 / ((sdiff.tv_usec + 0x400) / 0x400) + 0x10;
|
||||||
int mult = 1000000 / ((sdiff.tv_usec + 0x400) / 0x400) + 0x10;
|
|
||||||
mult *= cycle;
|
mult *= cycle;
|
||||||
if (max_nonce > (0xffffffff * 0x400) / mult)
|
if (max_nonce > (0xffffffff * 0x400) / mult)
|
||||||
max_nonce = 0xffffffff;
|
max_nonce = 0xffffffff;
|
||||||
else
|
else
|
||||||
max_nonce = (max_nonce * mult) / 0x400;
|
max_nonce = (max_nonce * mult) / 0x400;
|
||||||
}
|
} else if (unlikely(sdiff.tv_sec > cycle) && api->can_limit_work)
|
||||||
} else if (unlikely(sdiff.tv_sec > cycle) && api->can_limit_work) {
|
|
||||||
max_nonce = max_nonce * cycle / sdiff.tv_sec;
|
max_nonce = max_nonce * cycle / sdiff.tv_sec;
|
||||||
} else if (unlikely(sdiff.tv_usec > 100000) && api->can_limit_work) {
|
else if (unlikely(sdiff.tv_usec > 100000) && api->can_limit_work)
|
||||||
max_nonce = max_nonce * 0x400 / (((cycle * 1000000) + sdiff.tv_usec) / (cycle * 1000000 / 0x400));
|
max_nonce = max_nonce * 0x400 / (((cycle * 1000000) + sdiff.tv_usec) / (cycle * 1000000 / 0x400));
|
||||||
}
|
|
||||||
|
|
||||||
timersub(&tv_end, &tv_lastupdate, &diff);
|
timersub(&tv_end, &tv_lastupdate, &diff);
|
||||||
if (diff.tv_sec >= opt_log_interval) {
|
if (diff.tv_sec >= opt_log_interval) {
|
||||||
|
Loading…
Reference in New Issue
Block a user