mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 14:58:01 +00:00
Increment last device valid work count in submit_nonce to cover scrypt.
This commit is contained in:
parent
d49ecf198e
commit
3fa4a9f55f
15
cgminer.c
15
cgminer.c
@ -5547,10 +5547,6 @@ static int hashtest(struct thr_info *thr, struct work *work)
|
||||
return -1;
|
||||
}
|
||||
|
||||
mutex_lock(&stats_lock);
|
||||
thr->cgpu->last_device_valid_work = time(NULL);
|
||||
mutex_unlock(&stats_lock);
|
||||
|
||||
if (!fulltest(hash2, work->target)) {
|
||||
applog(LOG_INFO, "Share below target");
|
||||
/* Check the diff of the share, even if it didn't reach the
|
||||
@ -5584,9 +5580,16 @@ void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce)
|
||||
valid = hashtest(thr, work);
|
||||
|
||||
if (unlikely(valid == -1))
|
||||
inc_hw_errors(thr);
|
||||
else if (valid == 1)
|
||||
return inc_hw_errors(thr);
|
||||
|
||||
mutex_lock(&stats_lock);
|
||||
thr->cgpu->last_device_valid_work = time(NULL);
|
||||
mutex_unlock(&stats_lock);
|
||||
|
||||
if (valid == 1)
|
||||
submit_work_async(work, &tv_work_found);
|
||||
else
|
||||
applog(LOG_INFO, "Share below target");
|
||||
}
|
||||
|
||||
static inline bool abandon_work(struct work *work, struct timeval *wdiff, uint64_t hashes)
|
||||
|
Loading…
Reference in New Issue
Block a user