Skip to content

Commit 2eeeac6

Browse files
committed
AES override feature
1 parent 74c6914 commit 2eeeac6

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

config.txt

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

79+
/*
80+
* Manual hardware AES override
81+
*
82+
* Some VMs don't report AES capability correctly. You can set this value to true to make the miner use hardware
83+
* AES or to false to make it use software AES.
84+
*
85+
* WARNING: setting this to true on a CPU that doesn't support hardware AES will crash the miner.
86+
*/
87+
"aes_override" : null,
88+
7989
/*
8090
* TLS Settings
8191
* If you need real security, make sure tls_secure_algo is enabled (otherwise MITM attack can downgrade encryption

jconf.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ using namespace rapidjson;
4545
/*
4646
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
4747
*/
48-
enum configEnum { aCpuThreadsConf, sUseSlowMem, bNiceHashMode,
48+
enum configEnum { aCpuThreadsConf, sUseSlowMem, bNiceHashMode, bAesOverride,
4949
bTlsMode, bTlsSecureAlgo, sTlsFingerprint, sPoolAddr, sWalletAddr, sPoolPwd,
5050
iCallTimeout, iNetRetry, iGiveUpLimit, iVerboseLevel, iAutohashTime,
5151
bDaemonMode, sOutputFile, iHttpdPort, bPreferIpv4 };
@@ -62,6 +62,7 @@ configVal oConfigValues[] = {
6262
{ aCpuThreadsConf, "cpu_threads_conf", kNullType },
6363
{ sUseSlowMem, "use_slow_memory", kStringType },
6464
{ bNiceHashMode, "nicehash_nonce", kTrueType },
65+
{ bAesOverride, "aes_override", kNullType },
6566
{ bTlsMode, "use_tls", kTrueType },
6667
{ bTlsSecureAlgo, "tls_secure_algo", kTrueType },
6768
{ sTlsFingerprint, "tls_fingerprint", kStringType },
@@ -453,11 +454,14 @@ bool jconf::parse_config(const char* sFilename)
453454

454455
printer::inst()->set_verbose_level(prv->configValues[iVerboseLevel]->GetUint64());
455456

456-
if(!NeedsAutoconf())
457-
{
458-
if(!bHaveAes)
459-
printer::inst()->print_msg(L0, "Your CPU doesn't support hardware AES. Don't expect high hashrates.");
460-
}
457+
if(NeedsAutoconf())
458+
return true;
459+
460+
if(prv->configValues[bAesOverride]->IsBool())
461+
bHaveAes = prv->configValues[bAesOverride]->GetBool();
462+
463+
if(!bHaveAes)
464+
printer::inst()->print_msg(L0, "Your CPU doesn't support hardware AES. Don't expect high hashrates.");
461465

462466
return true;
463467
}

0 commit comments

Comments
 (0)