mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-15 00:59:59 +00:00
Use an array of offsets when checking nonces in bitfury_checkresults
This commit is contained in:
parent
44b9cf50e3
commit
fafd863138
@ -163,23 +163,20 @@ static uint32_t decnonce(uint32_t in)
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define BT_OFFSETS 3
|
||||||
|
const uint32_t bf_offsets[] = {0, -0x400000, -0x800000};
|
||||||
|
|
||||||
static bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce)
|
static bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce)
|
||||||
{
|
{
|
||||||
uint32_t nonceoff;
|
uint32_t offset_nonce;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (test_nonce(work, nonce)) {
|
for (i = 0; i < BT_OFFSETS; i++) {
|
||||||
submit_nonce(thr, work, nonce);
|
offset_nonce = nonce + bf_offsets[i];
|
||||||
return true;
|
if (test_nonce(work, offset_nonce)) {
|
||||||
}
|
submit_nonce(thr, work, offset_nonce);
|
||||||
nonceoff = nonce - 0x400000;
|
return true;
|
||||||
if (test_nonce(work, nonceoff)) {
|
}
|
||||||
submit_nonce(thr, work, nonceoff);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
nonceoff = nonce - 0x800000;
|
|
||||||
if (test_nonce(work, nonceoff)) {
|
|
||||||
submit_nonce(thr, work, nonceoff);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user