1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-09 20:21:01 +00:00

Meter out return of estimated hashes in BF1 to smooth out visible hashrate.

This commit is contained in:
Con Kolivas 2013-09-25 22:22:05 +10:00
parent 4507a3803b
commit 5a8ac9fdaf
2 changed files with 10 additions and 6 deletions

View File

@ -199,9 +199,8 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
{
struct cgpu_info *bitfury = thr->cgpu;
struct bitfury_info *info = bitfury->device_data;
int64_t hashes = 0;
char buf[45];
int amount, i;
char buf[45];
buf[0] = 'W';
memcpy(buf + 1, work->midstate, 32);
@ -238,15 +237,15 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
memcpy(&nonce, info->buf + i + 3, 4);
nonce = decnonce(nonce);
if (bitfury_checkresults(thr, info->prevwork1, nonce)) {
hashes += 0xffffffff;
info->nonces++;
continue;
}
if (bitfury_checkresults(thr, info->prevwork2, nonce)) {
hashes += 0xffffffff;
info->nonces++;
continue;
}
if (bitfury_checkresults(thr, work, nonce)) {
hashes += 0xffffffff;
info->nonces++;
continue;
}
}
@ -256,7 +255,11 @@ cascade:
info->prevwork2 = info->prevwork1;
info->prevwork1 = copy_work(work);
work->blk.nonce = 0xffffffff;
return hashes;
if (info->nonces) {
info->nonces--;
return (int64_t)0xffffffff;
}
return 0;
}
static void bitfury_flush_work(struct cgpu_info __maybe_unused *bitfury)

View File

@ -21,6 +21,7 @@ struct bitfury_info {
struct work *prevwork2;
char buf[512];
int tot;
int nonces;
};
#endif /* BITFURY_H */