summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-17 21:30:29 +0100
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-10-22 13:15:18 +0100
commitd3c5911f8e486ac0d08c5160f6d9bd934c697b91 (patch)
tree66441e722f2bbc8b99e6ba597b07bd6bb38aec59 /xmrstak/backend/cpu
parent27b839b8d2275c0e78a07cb03d27afb96ed6c7b9 (diff)
downloadxmr-stak-d3c5911f8e486ac0d08c5160f6d9bd934c697b91.zip
xmr-stak-d3c5911f8e486ac0d08c5160f6d9bd934c697b91.tar.gz
move nicehash check into nonce calc
Diffstat (limited to 'xmrstak/backend/cpu')
-rw-r--r--xmrstak/backend/cpu/minethd.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp
index 542e999..ac80cc2 100644
--- a/xmrstak/backend/cpu/minethd.cpp
+++ b/xmrstak/backend/cpu/minethd.cpp
@@ -348,6 +348,9 @@ void minethd::work_main()
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
memcpy(result.sJobID, oWork.sJobID, sizeof(job_result::sJobID));
+ if(oWork.bNiceHash)
+ result.iNonce = *piNonce;
+
while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{
if ((iCount++ & 0xF) == 0) //Store stats every 16 hashes
@@ -360,10 +363,7 @@ void minethd::work_main()
if((nonce_ctr++ & (nonce_chunk-1)) == 0)
{
- if(oWork.bNiceHash)
- result.iNonce = globalStates::inst().calc_start_nonce(*piNonce & 0xFF000000, nonce_chunk);
- else
- result.iNonce = globalStates::inst().calc_start_nonce(0, nonce_chunk);
+ globalStates::inst().calc_start_nonce(result.iNonce, oWork.bNiceHash, nonce_chunk);
}
*piNonce = ++result.iNonce;
@@ -466,6 +466,9 @@ void minethd::double_work_main()
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
+ if(oWork.bNiceHash)
+ iNonce = *piNonce0;
+
while (globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{
if ((iCount & 0x7) == 0) //Store stats every 16 hashes
@@ -480,10 +483,7 @@ void minethd::double_work_main()
if((nonce_ctr++ & (nonce_chunk/2 - 1)) == 0)
{
- if(oWork.bNiceHash)
- iNonce = globalStates::inst().calc_start_nonce(*piNonce0 & 0xFF000000, nonce_chunk);
- else
- iNonce = globalStates::inst().calc_start_nonce(0, nonce_chunk);
+ globalStates::inst().calc_start_nonce(iNonce, oWork.bNiceHash, nonce_chunk);
}
OpenPOWER on IntegriCloud