diff options
author | psychocrypt <psychocryptHPC@gmail.com> | 2018-05-22 23:05:46 +0200 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2018-06-04 21:07:11 +0000 |
commit | 34098ee5546d34068ae16963b9e875fd78e215f9 (patch) | |
tree | 83a6c348a40838dc399373c1058024fb76d0f74d /xmrstak/backend/amd | |
parent | 22732aa90e8eb1219691875b4019257535cff462 (diff) | |
download | xmr-stak-34098ee5546d34068ae16963b9e875fd78e215f9.zip xmr-stak-34098ee5546d34068ae16963b9e875fd78e215f9.tar.gz |
fix duplicated nonce usage
- avoid that a nonce which not fits to the current job is used (check jobId after start nonce is consumed)
- move jobId check into the if condition to get a new bunch of nonces
- CPU: add jobId validation after the start nonce is consumed
Diffstat (limited to 'xmrstak/backend/amd')
-rw-r--r-- | xmrstak/backend/amd/minethd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xmrstak/backend/amd/minethd.cpp b/xmrstak/backend/amd/minethd.cpp index 185e717..6d348b9 100644 --- a/xmrstak/backend/amd/minethd.cpp +++ b/xmrstak/backend/amd/minethd.cpp @@ -231,10 +231,11 @@ void minethd::work_main() if((round_ctr++ & 0xF) == 0) { globalStates::inst().calc_start_nonce(pGpuCtx->Nonce, oWork.bNiceHash, h_per_round * 16); + // check if the job is still valid, there is a small possibility that the job is switched + if(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) != iJobNo) + break; } - // check if the job is still valid, there is a small posibility that the job is switched - if(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) != iJobNo) - break; + cl_uint results[0x100]; memset(results,0,sizeof(cl_uint)*(0x100)); |