Merge commit
This commit is contained in:
commit
495d447cab
68 changed files with 1560 additions and 407 deletions
|
@ -177,8 +177,11 @@ void xmrig::CommonConfig::printVersions()
|
|||
int length = snprintf(buf, sizeof buf, "CUDA/%d.%d ", cudaVersion / 1000, cudaVersion % 100);
|
||||
# else
|
||||
memset(buf, 0, 16);
|
||||
|
||||
# if !defined(XMRIG_NO_HTTPD) || !defined(XMRIG_NO_TLS)
|
||||
int length = 0;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !defined(XMRIG_NO_TLS) && defined(OPENSSL_VERSION_TEXT)
|
||||
{
|
||||
|
@ -283,16 +286,16 @@ bool xmrig::CommonConfig::parseBoolean(int key, bool enable)
|
|||
break;
|
||||
|
||||
case KeepAliveKey: /* --keepalive */
|
||||
m_pools.back().setKeepAlive(enable ? Pool::kKeepAliveTimeout : 0);
|
||||
currentPool().setKeepAlive(enable ? Pool::kKeepAliveTimeout : 0);
|
||||
break;
|
||||
|
||||
case TlsKey: /* --tls */
|
||||
m_pools.back().setTLS(enable);
|
||||
currentPool().setTLS(enable);
|
||||
break;
|
||||
|
||||
# ifndef XMRIG_PROXY_PROJECT
|
||||
case NicehashKey: /* --nicehash */
|
||||
m_pools.back().setNicehash(enable);
|
||||
currentPool().setNicehash(enable);
|
||||
break;
|
||||
# endif
|
||||
|
||||
|
@ -340,13 +343,15 @@ bool xmrig::CommonConfig::parseString(int key, const char *arg)
|
|||
break;
|
||||
|
||||
case UserpassKey: /* --userpass */
|
||||
if (!m_pools.back().setUserpass(arg)) {
|
||||
if (!currentPool().setUserpass(arg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case UrlKey: /* --url */
|
||||
fixup();
|
||||
|
||||
if (m_pools.size() > 1 || m_pools[0].isValid()) {
|
||||
Pool pool(arg);
|
||||
|
||||
|
@ -365,23 +370,23 @@ bool xmrig::CommonConfig::parseString(int key, const char *arg)
|
|||
break;
|
||||
|
||||
case UserKey: /* --user */
|
||||
m_pools.back().setUser(arg);
|
||||
currentPool().setUser(arg);
|
||||
break;
|
||||
|
||||
case PasswordKey: /* --pass */
|
||||
m_pools.back().setPassword(arg);
|
||||
currentPool().setPassword(arg);
|
||||
break;
|
||||
|
||||
case RigIdKey: /* --rig-id */
|
||||
m_pools.back().setRigId(arg);
|
||||
currentPool().setRigId(arg);
|
||||
break;
|
||||
|
||||
case FingerprintKey: /* --tls-fingerprint */
|
||||
m_pools.back().setFingerprint(arg);
|
||||
currentPool().setFingerprint(arg);
|
||||
break;
|
||||
|
||||
case VariantKey: /* --variant */
|
||||
m_pools.back().algorithm().parseVariant(arg);
|
||||
currentPool().algorithm().parseVariant(arg);
|
||||
break;
|
||||
|
||||
case LogFileKey: /* --log-file */
|
||||
|
@ -407,7 +412,7 @@ bool xmrig::CommonConfig::parseString(int key, const char *arg)
|
|||
case RetriesKey: /* --retries */
|
||||
case RetryPauseKey: /* --retry-pause */
|
||||
case ApiPort: /* --api-port */
|
||||
case PrintTimeKey: /* --cpu-priority */
|
||||
case PrintTimeKey: /* --print-time */
|
||||
return parseUint64(key, strtol(arg, nullptr, 10));
|
||||
|
||||
case BackgroundKey: /* --background */
|
||||
|
@ -473,11 +478,11 @@ bool xmrig::CommonConfig::parseInt(int key, int arg)
|
|||
break;
|
||||
|
||||
case KeepAliveKey: /* --keepalive */
|
||||
m_pools.back().setKeepAlive(arg);
|
||||
currentPool().setKeepAlive(arg);
|
||||
break;
|
||||
|
||||
case VariantKey: /* --variant */
|
||||
m_pools.back().algorithm().parseVariant(arg);
|
||||
currentPool().algorithm().parseVariant(arg);
|
||||
break;
|
||||
|
||||
case DonateLevelKey: /* --donate-level */
|
||||
|
@ -510,3 +515,30 @@ bool xmrig::CommonConfig::parseInt(int key, int arg)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Pool &xmrig::CommonConfig::currentPool()
|
||||
{
|
||||
fixup();
|
||||
|
||||
return m_pools.back();
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CommonConfig::fixup()
|
||||
{
|
||||
if (m_state == NoneState) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pools.empty()) {
|
||||
if (!m_activePools.empty()) {
|
||||
std::swap(m_pools, m_activePools);
|
||||
}
|
||||
else {
|
||||
m_pools.push_back(Pool());
|
||||
}
|
||||
|
||||
m_state = NoneState;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue