summaryrefslogtreecommitdiffstats
path: root/jconf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'jconf.cpp')
-rw-r--r--jconf.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/jconf.cpp b/jconf.cpp
index 5879042..532ff7c 100644
--- a/jconf.cpp
+++ b/jconf.cpp
@@ -38,7 +38,8 @@ using namespace rapidjson;
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
*/
enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem, bNiceHashMode, bTlsMode, bTlsSecureAlgo, sTlsFingerprint,
- sPoolAddr, sWalletAddr, sPoolPwd, iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, iHttpdPort, bPreferIpv4 };
+ sPoolAddr, sWalletAddr, sPoolPwd, iCallTimeout, iNetRetry, iGiveUpLimit, iVerboseLevel, iAutohashTime, iHttpdPort,
+ bPreferIpv4 };
struct configVal {
configEnum iName;
@@ -60,6 +61,7 @@ configVal oConfigValues[] = {
{ sPoolPwd, "pool_password", kStringType },
{ iCallTimeout, "call_timeout", kNumberType },
{ iNetRetry, "retry_time", kNumberType },
+ { iGiveUpLimit, "giveup_limit", kNumberType },
{ iVerboseLevel, "verbose_level", kNumberType },
{ iAutohashTime, "h_print_time", kNumberType },
{ iHttpdPort, "httpd_port", kNumberType },
@@ -207,6 +209,11 @@ uint64_t jconf::GetNetRetry()
return prv->configValues[iNetRetry]->GetUint64();
}
+uint64_t jconf::GetGiveUpLimit()
+{
+ return prv->configValues[iGiveUpLimit]->GetUint64();
+}
+
uint64_t jconf::GetVerboseLevel()
{
return prv->configValues[iVerboseLevel]->GetUint64();
@@ -378,10 +385,12 @@ bool jconf::parse_config(const char* sFilename)
return false;
}
- if(!prv->configValues[iCallTimeout]->IsUint64() || !prv->configValues[iNetRetry]->IsUint64())
+ if(!prv->configValues[iCallTimeout]->IsUint64() ||
+ !prv->configValues[iNetRetry]->IsUint64() ||
+ !prv->configValues[iGiveUpLimit]->IsUint64())
{
printer::inst()->print_msg(L0,
- "Invalid config file. call_timeout and retry_time need to be positive integers.");
+ "Invalid config file. call_timeout, retry_time and giveup_limit need to be positive integers.");
return false;
}
OpenPOWER on IntegriCloud