Changed behavior for automatic variant to allow pool override algorithm.

This commit is contained in:
XMRig
2018-06-12 19:52:52 +07:00
parent 18330e3fd0
commit 93f2dab5cb
3 changed files with 19 additions and 5 deletions

View File

@@ -68,7 +68,7 @@ static AlgoData const algorithms[] = {
# endif
# ifndef XMRIG_NO_SUMO
{ "cryptonight-heavy", "cn-heavy", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_0 },
{ "cryptonight-heavy", "cn-heavy", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_AUTO },
{ "cryptonight-heavy/0", "cn-heavy/0", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_0 },
{ "cryptonight-heavy/xhv", "cn-heavy/xhv", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_XHV },
# endif

View File

@@ -332,6 +332,12 @@ bool Client::parseLogin(const rapidjson::Value &result, int *code)
bool Client::verifyAlgorithm(const xmrig::Algorithm &algorithm) const
{
# ifdef XMRIG_PROXY_PROJECT
if (m_pool.algorithm().variant() == xmrig::VARIANT_AUTO) {
return true;
}
# endif
if (m_pool.isCompatible(algorithm)) {
return true;
}
@@ -478,13 +484,19 @@ void Client::login()
params.AddMember("rigid", StringRef(m_pool.rigId()), allocator);
}
Value algo(kArrayType);
# ifdef XMRIG_PROXY_PROJECT
if (m_pool.algorithm().variant() != xmrig::VARIANT_AUTO)
# endif
{
Value algo(kArrayType);
for (const auto &a : m_pool.algorithms()) {
algo.PushBack(StringRef(a.shortName()), allocator);
for (const auto &a : m_pool.algorithms()) {
algo.PushBack(StringRef(a.shortName()), allocator);
}
params.AddMember("algo", algo, allocator);
}
params.AddMember("algo", algo, allocator);
doc.AddMember("params", params, allocator);
send(doc);

View File

@@ -232,6 +232,7 @@ void Pool::adjust(xmrig::Algo algorithm)
if (!m_algorithm.isValid()) {
m_algorithm.setAlgo(algorithm);
# ifndef XMRIG_PROXY_PROJECT
if (m_algorithm.variant() == xmrig::VARIANT_AUTO) {
if (algorithm == xmrig::CRYPTONIGHT_HEAVY) {
m_algorithm.setVariant(xmrig::VARIANT_0);
@@ -240,6 +241,7 @@ void Pool::adjust(xmrig::Algo algorithm)
m_algorithm.setVariant(xmrig::VARIANT_1);
}
}
# endif
}
if (strstr(m_host.data(), ".nicehash.com")) {