Skip to content

Commit f91229b

Browse files
committed
New settings
1 parent a68b282 commit f91229b

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

config.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
*/
7878
"nicehash_nonce" : false,
7979

80+
/*
81+
* TLS Settings
82+
* use_tls - This option will make us connect using Transport Layer Security.
83+
* tls_secure_algo - Use only secure algorithms. This will make us quit with an error if we can't negotiate a secure algo.
84+
* tls_fingerprint - Server's SHA256 fingerprint. If this string is non-empty then we will check the server's cert against it.
85+
*/
86+
"use_tls" : false,
87+
"tls_secure_algo" : true,
88+
"tls_fingerprint" : "",
89+
8090
/*
8191
* pool_address - Pool address should be in the form "pool.supportxmr.com:3333". Only stratum pools are supported.
8292
* wallet_address - Your wallet, or pool login.

jconf.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ using namespace rapidjson;
3737
/*
3838
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
3939
*/
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 };
4242

4343
struct configVal {
4444
configEnum iName;
@@ -52,6 +52,9 @@ configVal oConfigValues[] = {
5252
{ aCpuThreadsConf, "cpu_threads_conf", kArrayType },
5353
{ sUseSlowMem, "use_slow_memory", kStringType },
5454
{ bNiceHashMode, "nicehash_nonce", kTrueType },
55+
{ bTlsMode, "use_tls", kTrueType },
56+
{ bTlsSecureAlgo, "tls_secure_algo", kTrueType },
57+
{ sTlsFingerprint, "tls_fingerprint", kStringType },
5558
{ sPoolAddr, "pool_address", kStringType },
5659
{ sWalletAddr, "wallet_address", kStringType },
5760
{ sPoolPwd, "pool_password", kStringType },
@@ -154,6 +157,21 @@ jconf::slow_mem_cfg jconf::GetSlowMemSetting()
154157
return unknown_value;
155158
}
156159

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+
157175
const char* jconf::GetPoolAddress()
158176
{
159177
return prv->configValues[sPoolAddr]->GetString();
@@ -337,6 +355,12 @@ bool jconf::parse_config(const char* sFilename)
337355
return false;
338356
}
339357

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+
340364
thd_cfg c;
341365
for(size_t i=0; i < n_thd; i++)
342366
{
@@ -378,7 +402,7 @@ bool jconf::parse_config(const char* sFilename)
378402
#ifdef _WIN32
379403
if(GetSlowMemSetting() == no_mlck)
380404
{
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.");
382406
return false;
383407
}
384408
#endif // _WIN32

0 commit comments

Comments
 (0)