summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu/minethd.cpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-01-27 21:05:45 +0100
committerpsychocrypt <psychocryptHPC@gmail.com>2018-01-27 21:10:03 +0100
commite191229ac1b190da99209eebb2858ace94d27df9 (patch)
treecb43fc9b81ebcf2a77bc535090150d1d3ed4584a /xmrstak/backend/cpu/minethd.cpp
parentbaba941e6fad70c1cb6b29db90acb8ebf07c3204 (diff)
downloadxmr-stak-e191229ac1b190da99209eebb2858ace94d27df9.zip
xmr-stak-e191229ac1b190da99209eebb2858ace94d27df9.tar.gz
void nonce overlappping
The cpu miner backend uses the wrong ranges of nonces instead of using `[startNonce,startNonce + nonce_chunk)` (startNonce,startNonce + nonce_chunk]` is used. This will results in an overlap with nonces used by the gpu back-ends.
Diffstat (limited to 'xmrstak/backend/cpu/minethd.cpp')
-rw-r--r--xmrstak/backend/cpu/minethd.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp
index 1d9165e..cef4f8e 100644
--- a/xmrstak/backend/cpu/minethd.cpp
+++ b/xmrstak/backend/cpu/minethd.cpp
@@ -448,12 +448,13 @@ void minethd::work_main()
globalStates::inst().calc_start_nonce(result.iNonce, oWork.bNiceHash, nonce_chunk);
}
- *piNonce = ++result.iNonce;
+ *piNonce = result.iNonce;
hash_fun(oWork.bWorkBlob, oWork.iWorkSize, result.bResult, ctx);
if (*piHashVal < oWork.iTarget)
executor::inst()->push_event(ex_event(result, oWork.iPoolId));
+ result.iNonce++;
std::this_thread::yield();
}
@@ -637,7 +638,7 @@ void minethd::multiway_work_main(cn_hash_fun_multi hash_fun_multi)
}
for (size_t i = 0; i < N; i++)
- *piNonce[i] = ++iNonce;
+ *piNonce[i] = iNonce++;
hash_fun_multi(bWorkBlob, oWork.iWorkSize, bHashOut, ctx);
@@ -645,7 +646,7 @@ void minethd::multiway_work_main(cn_hash_fun_multi hash_fun_multi)
{
if (*piHashVal[i] < oWork.iTarget)
{
- executor::inst()->push_event(ex_event(job_result(oWork.sJobID, iNonce - N + 1 + i, bHashOut + 32 * i, iThreadNo), oWork.iPoolId));
+ executor::inst()->push_event(ex_event(job_result(oWork.sJobID, iNonce - N + i, bHashOut + 32 * i, iThreadNo), oWork.iPoolId));
}
}
OpenPOWER on IntegriCloud