@@ -37,8 +37,8 @@ using namespace rapidjson;
37
37
/*
38
38
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
39
39
*/
40
- enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem , bNiceHashMode, sPoolAddr , sWalletAddr ,
41
- sPoolPwd , iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, iHttpdPort, bPreferIpv4 };
40
+ enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem , bNiceHashMode, bTlsMode, bTlsSecureAlgo, sTlsFingerprint ,
41
+ sPoolAddr , sWalletAddr , sPoolPwd , iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, iHttpdPort, bPreferIpv4 };
42
42
43
43
struct configVal {
44
44
configEnum iName;
@@ -52,6 +52,9 @@ configVal oConfigValues[] = {
52
52
{ aCpuThreadsConf, " cpu_threads_conf" , kArrayType },
53
53
{ sUseSlowMem , " use_slow_memory" , kStringType },
54
54
{ bNiceHashMode, " nicehash_nonce" , kTrueType },
55
+ { bTlsMode, " use_tls" , kTrueType },
56
+ { bTlsSecureAlgo, " tls_secure_algo" , kTrueType },
57
+ { sTlsFingerprint , " tls_fingerprint" , kStringType },
55
58
{ sPoolAddr , " pool_address" , kStringType },
56
59
{ sWalletAddr , " wallet_address" , kStringType },
57
60
{ sPoolPwd , " pool_password" , kStringType },
@@ -154,6 +157,21 @@ jconf::slow_mem_cfg jconf::GetSlowMemSetting()
154
157
return unknown_value;
155
158
}
156
159
160
+ bool jconf::GetTlsSetting ()
161
+ {
162
+ return prv->configValues [bTlsMode]->GetBool ();
163
+ }
164
+
165
+ bool jconf::TlsSecureAlgos ()
166
+ {
167
+ return prv->configValues [bTlsSecureAlgo]->GetBool ();
168
+ }
169
+
170
+ const char * jconf::GetTlsFingerprint ()
171
+ {
172
+ return prv->configValues [sTlsFingerprint ]->GetString ();
173
+ }
174
+
157
175
const char * jconf::GetPoolAddress ()
158
176
{
159
177
return prv->configValues [sPoolAddr ]->GetString ();
@@ -337,6 +355,12 @@ bool jconf::parse_config(const char* sFilename)
337
355
return false ;
338
356
}
339
357
358
+ if (NiceHashMode () && n_thd >= 32 )
359
+ {
360
+ printer::inst ()->print_msg (L0, " You need to use less than 32 threads in NiceHash mode." );
361
+ return false ;
362
+ }
363
+
340
364
thd_cfg c;
341
365
for (size_t i=0 ; i < n_thd; i++)
342
366
{
@@ -378,7 +402,7 @@ bool jconf::parse_config(const char* sFilename)
378
402
#ifdef _WIN32
379
403
if (GetSlowMemSetting () == no_mlck)
380
404
{
381
- printer::inst ()->print_msg (L0, " On Windows large pages need mlock. Please use another option.\n " );
405
+ printer::inst ()->print_msg (L0, " On Windows large pages need mlock. Please use another option." );
382
406
return false ;
383
407
}
384
408
#endif // _WIN32
0 commit comments