summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/nvidia/minethd.cpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-05-22 23:05:46 +0200
committerpsychocrypt <psychocryptHPC@gmail.com>2018-05-22 23:05:46 +0200
commit0d85a32dce63bb8c735fd8a8ab0e71b474b9b399 (patch)
treeb06b0f8690e7e8ec4793c5a2741519718d9dfcee /xmrstak/backend/nvidia/minethd.cpp
parent5cb446380f8e4140a94e8d299287a672c0fa6895 (diff)
downloadxmr-stak-0d85a32dce63bb8c735fd8a8ab0e71b474b9b399.zip
xmr-stak-0d85a32dce63bb8c735fd8a8ab0e71b474b9b399.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/nvidia/minethd.cpp')
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index a21e525..16171e1 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -275,10 +275,10 @@ void minethd::work_main()
if((round_ctr++ & 0xF) == 0)
{
globalStates::inst().calc_start_nonce(iNonce, oWork.bNiceHash, h_per_round * 16);
+ // 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;
}
- // 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;
uint32_t foundNonce[10];
uint32_t foundCount;
OpenPOWER on IntegriCloud