summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xmrstak/backend/amd/minethd.cpp7
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp6
2 files changed, 11 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/minethd.cpp b/xmrstak/backend/amd/minethd.cpp
index 5f36428..84f0055 100644
--- a/xmrstak/backend/amd/minethd.cpp
+++ b/xmrstak/backend/amd/minethd.cpp
@@ -173,6 +173,7 @@ void minethd::work_main()
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
globalStates::inst().iConsumeCnt++;
+ uint32_t* piNonce = (uint32_t*)(oWork.bWorkBlob + 39);
while (bQuit == 0)
{
@@ -189,8 +190,12 @@ void minethd::work_main()
continue;
}
+ if(oWork.bNiceHash)
+ pGpuCtx->Nonce = calc_nicehash_nonce(*piNonce, oWork.iResumeCnt);
+ else
+ pGpuCtx->Nonce = calc_start_nonce(oWork.iResumeCnt);
+
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
- pGpuCtx->Nonce = calc_start_nonce(oWork.iResumeCnt);
uint32_t target = oWork.iTarget32;
XMRSetJob(pGpuCtx, oWork.bWorkBlob, oWork.iWorkSize, target);
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index b4080fe..a4aa519 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -196,6 +196,7 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
+ uint32_t* piNonce = (uint32_t*)(oWork.bWorkBlob + 39);
globalStates::inst().iConsumeCnt++;
@@ -221,7 +222,10 @@ void minethd::work_main()
}
cryptonight_extra_cpu_set_data(&ctx, oWork.bWorkBlob, oWork.iWorkSize);
- iNonce = calc_start_nonce(oWork.iResumeCnt);
+ if(oWork.bNiceHash)
+ iNonce = calc_nicehash_nonce(*piNonce, oWork.iResumeCnt);
+ else
+ iNonce = calc_start_nonce(oWork.iResumeCnt);
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
OpenPOWER on IntegriCloud