summaryrefslogtreecommitdiffstats
path: root/xmrstak/jconf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/jconf.cpp')
-rw-r--r--xmrstak/jconf.cpp58
1 files changed, 24 insertions, 34 deletions
diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp
index 100b5df..12d684c 100644
--- a/xmrstak/jconf.cpp
+++ b/xmrstak/jconf.cpp
@@ -79,35 +79,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 },
+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, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "cryptonight", {cryptonight, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "cryptonight_lite", {cryptonight_lite, cryptonight_lite, 0u}, {cryptonight_lite, cryptonight_lite, 0u}, nullptr },
+ { "edollar", {cryptonight, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "electroneum", {cryptonight, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "graft", {cryptonight_monero, cryptonight, 8u}, {cryptonight_monero, cryptonight, 7u}, nullptr },
+ { "haven", {cryptonight_heavy, cryptonight, 2u}, {cryptonight_heavy, cryptonight, 3u}, nullptr },
+ { "intense", {cryptonight, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "karbo", {cryptonight, cryptonight, 0u}, {cryptonight, cryptonight, 0u}, nullptr },
+ { "monero7", {cryptonight_monero, cryptonight, 7u}, {cryptonight_monero, cryptonight, 7u}, "pool.usxmrpool.com:3333" },
+ { "stellite", {cryptonight_monero, cryptonight, 3u}, {cryptonight_monero, cryptonight, 7u}, nullptr },
{ "cryptonight_heavy", cryptonight_heavy, cryptonight_heavy, 0u, nullptr },
+ { "sumokoin", {cryptonight_heavy, cryptonight, 3u}, {cryptonight_heavy, cryptonight, 3u}, 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 }
};
-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)
{
@@ -294,7 +286,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";
}
}
@@ -312,7 +304,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;
@@ -324,10 +316,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;
}
@@ -611,16 +603,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);
OpenPOWER on IntegriCloud