summaryrefslogtreecommitdiffstats
path: root/xmrstak/jconf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/jconf.cpp')
-rw-r--r--xmrstak/jconf.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp
index c033e66..fce1751 100644
--- a/xmrstak/jconf.cpp
+++ b/xmrstak/jconf.cpp
@@ -46,7 +46,7 @@ using namespace rapidjson;
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
*/
enum configEnum {
- bTlsMode, bTlsSecureAlgo, sTlsFingerprint, sPoolAddr, sWalletAddr, sPoolPwd,
+ bTlsMode, bTlsSecureAlgo, sTlsFingerprint, sPoolAddr, sWalletAddr, sPoolPwd,sCurrency,
iCallTimeout, iNetRetry, iGiveUpLimit, iVerboseLevel, iAutohashTime,
bDaemonMode, sOutputFile, iHttpdPort, bPreferIpv4, bNiceHashMode, bAesOverride, sUseSlowMem };
@@ -65,6 +65,7 @@ configVal oConfigValues[] = {
{ sPoolAddr, "pool_address", kStringType },
{ sWalletAddr, "wallet_address", kStringType },
{ sPoolPwd, "pool_password", kStringType },
+ { sCurrency, "currency", kStringType },
{ iCallTimeout, "call_timeout", kNumberType },
{ iNetRetry, "retry_time", kNumberType },
{ iGiveUpLimit, "giveup_limit", kNumberType },
@@ -150,6 +151,43 @@ const char* jconf::GetWalletAddress()
return poolUsername.c_str();
}
+const std::string jconf::GetCurrency()
+{
+ auto& currency = xmrstak::params::inst().currency;
+ if(currency.empty())
+ currency = prv->configValues[sCurrency]->GetString();
+ if(
+#ifndef CONF_NO_XMR
+ currency.compare("xmr") != 0
+#else
+ true
+#endif
+ &&
+#ifndef CONF_NO_AEON
+ currency.compare("aeon") != 0
+#else
+ true
+#endif
+ )
+ {
+ printer::inst()->print_msg(L0, "ERROR: Wrong currency selected - '%s'.", currency.c_str());
+ win_exit();
+ }
+ return currency;
+}
+
+bool jconf::IsCurrencyXMR()
+{
+ if(::jconf::inst()->GetCurrency().compare("xmr") == 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
bool jconf::PreferIpv4()
{
return prv->configValues[bPreferIpv4]->GetBool();
OpenPOWER on IntegriCloud