summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/nvidia/minethd.cpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-03-27 20:54:47 +0200
committerpsychocrypt <psychocryptHPC@gmail.com>2018-03-27 21:17:36 +0200
commit5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8 (patch)
tree8185467fb893d95a9e3ada6a19d77973432c3e24 /xmrstak/backend/nvidia/minethd.cpp
parent09a5dcce2c51d87d77244970d2c09bea3207da7a (diff)
downloadxmr-stak-5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8.zip
xmr-stak-5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8.tar.gz
POW AEON v7
- add new pow for AEON - fix missing cryptonight-heavy selection for multi hashes
Diffstat (limited to 'xmrstak/backend/nvidia/minethd.cpp')
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index 153e4e3..f8e8409 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -238,14 +238,10 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx();
auto miner_algo = ::jconf::inst()->GetMiningAlgo();
- cn_hash_fun hash_fun;
- if(miner_algo == cryptonight_monero || miner_algo == cryptonight_heavy)
- {
- // start with cryptonight and switch later if fork version is reached
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight);
- }
- else
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo);
+
+ // start with root algorithm and switch later if fork version is reached
+ cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, ::jconf::inst()->GetMiningAlgoRoot());
+
uint32_t iNonce;
globalStates::inst().iConsumeCnt++;
@@ -266,13 +262,12 @@ void minethd::work_main()
consume_work();
uint8_t new_version = oWork.getVersion();
- if(miner_algo == cryptonight_monero && version < 7 && new_version >= 7)
+ const bool time_to_fork =
+ ((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon) && version < 7 && new_version >= 7) ||
+ (miner_algo == cryptonight_heavy && version < 3 && new_version >= 3);
+ if(time_to_fork)
{
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_monero);
- }
- else if(miner_algo == cryptonight_heavy && version < 3 && new_version >= 3)
- {
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_heavy);
+ hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo);
}
version = new_version;
continue;
@@ -335,13 +330,12 @@ void minethd::work_main()
consume_work();
uint8_t new_version = oWork.getVersion();
- if(miner_algo == cryptonight_monero && version < 7 && new_version >= 7)
- {
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_monero);
- }
- else if(miner_algo == cryptonight_heavy && version < 3 && new_version >= 3)
+ const bool time_to_fork =
+ ((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon) && version < 7 && new_version >= 7) ||
+ (miner_algo == cryptonight_heavy && version < 3 && new_version >= 3);
+ if(time_to_fork)
{
- hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_heavy);
+ hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo);
}
version = new_version;
}
OpenPOWER on IntegriCloud