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/jconf.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/jconf.cpp')
-rw-r--r-- | xmrstak/jconf.cpp | 64 |
1 files changed, 27 insertions, 37 deletions
diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp index 6fad9b4..2add3db 100644 --- a/xmrstak/jconf.cpp +++ b/xmrstak/jconf.cpp @@ -86,35 +86,27 @@ configVal oConfigValues[] = { constexpr size_t iConfigCnt = (sizeof(oConfigValues)/sizeof(oConfigValues[0])); -struct xmrstak_coin_algo -{ - const char* coin_name; - xmrstak_algo algo; - xmrstak_algo algo_root; - uint8_t fork_version; - const char* default_pool; -}; - -xmrstak_coin_algo coin_algos[] = { - { "aeon7", cryptonight_aeon, cryptonight_lite, 7u, "mine.aeon-pool.com:5555" }, - { "croat", cryptonight, cryptonight, 0u, nullptr }, - { "cryptonight", cryptonight, cryptonight, 0u, nullptr }, - { "cryptonight_lite", cryptonight_lite, cryptonight_lite, 0u, nullptr }, - { "cryptonight_heavy", cryptonight_heavy, cryptonight_heavy, 0u, nullptr }, - { "cryptonight_lite_v7", cryptonight_aeon, cryptonight_aeon, 0u, nullptr }, - { "cryptonight_v7", cryptonight_monero, cryptonight_monero, 0u, nullptr }, - { "edollar", cryptonight, cryptonight, 0u, nullptr }, - { "electroneum", cryptonight, cryptonight, 0u, nullptr }, - { "graft", cryptonight_monero, cryptonight, 8u, nullptr }, - { "haven", cryptonight_heavy, cryptonight, 2u, nullptr }, - { "intense", cryptonight, cryptonight, 0u, nullptr }, - { "karbo", cryptonight, cryptonight, 0u, nullptr }, - { "monero7", cryptonight_monero, cryptonight, 7u, "pool.usxmrpool.com:3333" }, - { "stellite", cryptonight_monero, cryptonight, 3u, nullptr }, - { "sumokoin", cryptonight_heavy, cryptonight, 3u, nullptr } +xmrstak::coin_selection coins[] = { + // name, userpool, devpool, default_pool_suggestion + { "aeon7", {cryptonight_aeon, cryptonight_lite, 7u}, {cryptonight_aeon, cryptonight_lite, 7u}, "mine.aeon-pool.com:5555" }, + { "croat", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "cryptonight", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "cryptonight_heavy", {cryptonight_heavy, cryptonight_heavy, 0u}, {cryptonight_heavy, cryptonight_heavy, 0u}, nullptr }, + { "cryptonight_lite", {cryptonight_aeon, cryptonight_lite, 255u}, {cryptonight_aeon, cryptonight_lite, 7u}, nullptr }, + { "cryptonight_lite_v7", {cryptonight_lite, cryptonight_aeon, 255u}, {cryptonight_aeon, cryptonight_lite, 7u}, nullptr }, + { "cryptonight_v7", {cryptonight_monero, cryptonight_monero, 0u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "edollar", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "electroneum", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "graft", {cryptonight_monero, cryptonight, 8u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "haven", {cryptonight_heavy, cryptonight, 2u}, {cryptonight_heavy, cryptonight_heavy, 0u}, nullptr }, + { "intense", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "karbo", {cryptonight_monero, cryptonight, 255u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "monero7", {cryptonight_monero, cryptonight_monero, 0u}, {cryptonight_monero, cryptonight_monero, 0u}, "pool.usxmrpool.com:3333" }, + { "stellite", {cryptonight_monero, cryptonight, 3u}, {cryptonight_monero, cryptonight_monero, 0u}, nullptr }, + { "sumokoin", {cryptonight_heavy, cryptonight_heavy, 0u}, {cryptonight_heavy, cryptonight_heavy, 0u}, nullptr } }; -constexpr size_t coin_alogo_size = (sizeof(coin_algos)/sizeof(coin_algos[0])); +constexpr size_t coin_alogo_size = (sizeof(coins)/sizeof(coins[0])); inline bool checkType(Type have, Type want) { @@ -318,7 +310,7 @@ void jconf::GetAlgoList(std::string& list) for(size_t i=0; i < coin_alogo_size; i++) { list += "\t- "; - list += coin_algos[i].coin_name; + list += coins[i].coin_name; list += "\n"; } } @@ -336,7 +328,7 @@ bool jconf::IsOnAlgoList(std::string& needle) for(size_t i=0; i < coin_alogo_size; i++) { - if(needle == coin_algos[i].coin_name) + if(needle == coins[i].coin_name) return true; } return false; @@ -348,10 +340,10 @@ const char* jconf::GetDefaultPool(const char* needle) for(size_t i=0; i < coin_alogo_size; i++) { - if(strcmp(needle, coin_algos[i].coin_name) == 0) + if(strcmp(needle, coins[i].coin_name) == 0) { - if(coin_algos[i].default_pool != nullptr) - return coin_algos[i].default_pool; + if(coins[i].default_pool != nullptr) + return coins[i].default_pool; else return default_example; } @@ -635,16 +627,14 @@ bool jconf::parse_config(const char* sFilename, const char* sFilenamePools) return false; } - if(ctmp == coin_algos[i].coin_name) + if(ctmp == coins[i].coin_name) { - mining_algo = coin_algos[i].algo; - mining_algo_root = coin_algos[i].algo_root; - mining_fork_version = coin_algos[i].fork_version; + currentCoin = coins[i]; break; } } - if(mining_algo == invalid_algo) + if(currentCoin.GetDescription(1).GetMiningAlgo() == invalid_algo) { std::string cl; GetAlgoList(cl); |