diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2018-04-18 21:28:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 21:28:09 +0100 |
commit | 26a5d65f12b2f19a0a3ece39a2bc64718796367b (patch) | |
tree | b0132803b520fed0dcb2ea42ba5ab8f0a464fc12 /xmrstak/backend/nvidia/minethd.cpp | |
parent | e10e8e67492cf3118af8b7d7609937e85e572305 (diff) | |
parent | 27da3b0831e047a247f78ec299ba74b04f45bd5a (diff) | |
download | xmr-stak-26a5d65f12b2f19a0a3ece39a2bc64718796367b.zip xmr-stak-26a5d65f12b2f19a0a3ece39a2bc64718796367b.tar.gz |
Merge pull request #1459 from fireice-uk/dev2.4.3
release 2.4.3
Diffstat (limited to 'xmrstak/backend/nvidia/minethd.cpp')
-rw-r--r-- | xmrstak/backend/nvidia/minethd.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp index 804c06a..92f5f78 100644 --- a/xmrstak/backend/nvidia/minethd.cpp +++ b/xmrstak/backend/nvidia/minethd.cpp @@ -239,7 +239,7 @@ void minethd::work_main() cpu_ctx = cpu::minethd::minethd_alloc_ctx(); // start with root algorithm and switch later if fork version is reached - auto miner_algo = ::jconf::inst()->GetMiningAlgoRoot(); + auto miner_algo = ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgoRoot(); cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); uint32_t iNonce; @@ -247,6 +247,7 @@ void minethd::work_main() globalStates::inst().iConsumeCnt++; uint8_t version = 0; + size_t lastPoolId = 0; while (bQuit == 0) { @@ -264,13 +265,20 @@ void minethd::work_main() continue; } uint8_t new_version = oWork.getVersion(); - if(new_version != version) + if(new_version != version || oWork.iPoolId != lastPoolId) { - if(new_version >= ::jconf::inst()->GetMiningForkVersion()) + coinDescription coinDesc = ::jconf::inst()->GetCurrentCoinSelection().GetDescription(oWork.iPoolId); + if(new_version >= coinDesc.GetMiningForkVersion()) { - miner_algo = ::jconf::inst()->GetMiningAlgo(); + miner_algo = coinDesc.GetMiningAlgo(); hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); } + else + { + miner_algo = coinDesc.GetMiningAlgoRoot(); + hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); + } + lastPoolId = oWork.iPoolId; version = new_version; } |