mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-13 06:01:03 +00:00
Wrap result wrong tests in avalon scanhash in unlikely() and only consider a hash count of zero wrong if a restart wasn't issued.
This commit is contained in:
parent
0eb81d694a
commit
c62b985c04
@ -908,7 +908,7 @@ static int64_t avalon_scanhash(struct thr_info *thr)
|
|||||||
info->no_matching_work++;
|
info->no_matching_work++;
|
||||||
result_wrong++;
|
result_wrong++;
|
||||||
|
|
||||||
if (result_wrong >= avalon_get_work_count)
|
if (unlikely(result_wrong >= avalon_get_work_count))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (opt_debug) {
|
if (opt_debug) {
|
||||||
@ -929,7 +929,8 @@ static int64_t avalon_scanhash(struct thr_info *thr)
|
|||||||
elapsed.tv_sec, elapsed.tv_usec);
|
elapsed.tv_sec, elapsed.tv_usec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result_wrong >= avalon_get_work_count || hash_count == 0) {
|
if (unlikely(result_wrong >= avalon_get_work_count ||
|
||||||
|
(hash_count == 0 && ret != AVA_GETS_RESTART))) {
|
||||||
/* This means FPGA controller gave all wrong results, so
|
/* This means FPGA controller gave all wrong results, so
|
||||||
* try to reset the Avalon */
|
* try to reset the Avalon */
|
||||||
do_avalon_close(thr);
|
do_avalon_close(thr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user