diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2018-04-17 21:00:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 21:00:02 +0100 |
commit | 54403e8ed6c038c8c25bf2798bedd341a86cf7f5 (patch) | |
tree | 2b6a6298b0c23b575caff765b30d3e3ac2bdfcca /xmrstak/backend/nvidia/minethd.cpp | |
parent | 9df1d4d608f59e81e1e7db1f9b20dd2807e7dd6e (diff) | |
parent | 9fcf6807cc981136e95d8b8a2568e9ce2a6a6c8f (diff) | |
download | xmr-stak-54403e8ed6c038c8c25bf2798bedd341a86cf7f5.zip xmr-stak-54403e8ed6c038c8c25bf2798bedd341a86cf7f5.tar.gz |
Merge pull request #1437 from psychocrypt/fix-wrongAlgoSelection
fix wrong algo selection
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; } |