summaryrefslogtreecommitdiffstats
path: root/jconf.cpp
diff options
context:
space:
mode:
authorfireice-uk <fireice2@o2.pl>2017-01-11 02:44:28 +0000
committerfireice-uk <fireice2@o2.pl>2017-01-11 02:44:28 +0000
commitfb6bf3ec4bc85cbf1f703f9f6b930c865479b4e8 (patch)
tree5b2efa7f7e78ce218a4f048fa1b24bdcd5f55ed1 /jconf.cpp
parent947cb8004f5857393645b37861ebfb6f8873fd41 (diff)
downloadxmr-stak-fb6bf3ec4bc85cbf1f703f9f6b930c865479b4e8.zip
xmr-stak-fb6bf3ec4bc85cbf1f703f9f6b930c865479b4e8.tar.gz
v1.0.1 candidate - new more verbose level
Diffstat (limited to 'jconf.cpp')
-rw-r--r--jconf.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/jconf.cpp b/jconf.cpp
index dc87088..12df8d6 100644
--- a/jconf.cpp
+++ b/jconf.cpp
@@ -35,7 +35,7 @@ using namespace rapidjson;
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
*/
enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem, sPoolAddr,
- sWalletAddr, sPoolPwd, iCallTimeout, iNetRetry, iVerboseLevel, bPreferIpv4 };
+ sWalletAddr, sPoolPwd, iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, bPreferIpv4 };
struct configVal {
configEnum iName;
@@ -54,6 +54,7 @@ configVal oConfigValues[] = {
{ iCallTimeout, "call_timeout", kNumberType },
{ iNetRetry, "retry_time", kNumberType },
{ iVerboseLevel, "verbose_level", kNumberType },
+ { iAutohashTime, "h_print_time", kNumberType },
{ bPreferIpv4, "prefer_ipv4", kTrueType }
};
@@ -174,9 +175,14 @@ uint64_t jconf::GetNetRetry()
return prv->configValues[iNetRetry]->GetUint64();
}
-int64_t jconf::GetVerboseLevel()
+uint64_t jconf::GetVerboseLevel()
{
- return prv->configValues[iVerboseLevel]->GetInt64();
+ return prv->configValues[iVerboseLevel]->GetUint64();
+}
+
+uint64_t jconf::GetAutohashTime()
+{
+ return prv->configValues[iAutohashTime]->GetUint64();
}
bool jconf::parse_config(const char* sFilename)
@@ -290,10 +296,10 @@ bool jconf::parse_config(const char* sFilename)
return false;
}
- if(!prv->configValues[iVerboseLevel]->IsInt64())
+ if(!prv->configValues[iVerboseLevel]->IsUint64() || !prv->configValues[iAutohashTime]->IsUint64())
{
printer::inst()->print_msg(L0,
- "Invalid config file. verbose_level has to be an integer.");
+ "Invalid config file. verbose_level and h_print_time need to be positive integers.");
return false;
}
OpenPOWER on IntegriCloud