mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 18:11:05 +00:00
Sync changes with proxy.
This commit is contained in:
parent
63fed427f4
commit
33d9094cdc
3 changed files with 29 additions and 12 deletions
|
@ -68,7 +68,7 @@ static AlgoData const algorithms[] = {
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifndef XMRIG_NO_SUMO
|
# 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/0", "cn-heavy/0", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_0 },
|
||||||
{ "cryptonight-heavy/xhv", "cn-heavy/xhv", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_XHV },
|
{ "cryptonight-heavy/xhv", "cn-heavy/xhv", xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_XHV },
|
||||||
# endif
|
# endif
|
||||||
|
@ -77,13 +77,16 @@ static AlgoData const algorithms[] = {
|
||||||
|
|
||||||
#ifdef XMRIG_PROXY_PROJECT
|
#ifdef XMRIG_PROXY_PROJECT
|
||||||
static AlgoData const xmrStakAlgorithms[] = {
|
static AlgoData const xmrStakAlgorithms[] = {
|
||||||
{ "cryptonight-monerov7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
{ "cryptonight-monerov7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
||||||
{ "cryptonight_v7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
{ "cryptonight_v7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
||||||
{ "cryptonight_v7_stellite", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_XTL },
|
{ "cryptonight_v7_stellite", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_XTL },
|
||||||
{ "cryptonight_lite", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_0 },
|
{ "cryptonight_lite", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_0 },
|
||||||
{ "cryptonight-aeonv7", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_1 },
|
{ "cryptonight-aeonv7", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_1 },
|
||||||
{ "cryptonight_lite_v7", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_1 },
|
{ "cryptonight_lite_v7", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_1 },
|
||||||
{ "cryptonight_lite_v7_xor", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_IPBC },
|
{ "cryptonight_lite_v7_xor", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_IPBC },
|
||||||
|
{ "cryptonight_heavy", nullptr, xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_0 },
|
||||||
|
{ "cryptonight_haven", nullptr, xmrig::CRYPTONIGHT_HEAVY, xmrig::VARIANT_XHV },
|
||||||
|
{ "cryptonight_masari", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_MSR },
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -332,6 +332,12 @@ bool Client::parseLogin(const rapidjson::Value &result, int *code)
|
||||||
|
|
||||||
bool Client::verifyAlgorithm(const xmrig::Algorithm &algorithm) const
|
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)) {
|
if (m_pool.isCompatible(algorithm)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -478,13 +484,19 @@ void Client::login()
|
||||||
params.AddMember("rigid", StringRef(m_pool.rigId()), allocator);
|
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()) {
|
for (const auto &a : m_pool.algorithms()) {
|
||||||
algo.PushBack(StringRef(a.shortName()), allocator);
|
algo.PushBack(StringRef(a.shortName()), allocator);
|
||||||
|
}
|
||||||
|
|
||||||
|
params.AddMember("algo", algo, allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
params.AddMember("algo", algo, allocator);
|
|
||||||
doc.AddMember("params", params, allocator);
|
doc.AddMember("params", params, allocator);
|
||||||
|
|
||||||
send(doc);
|
send(doc);
|
||||||
|
|
|
@ -232,6 +232,7 @@ void Pool::adjust(xmrig::Algo algorithm)
|
||||||
if (!m_algorithm.isValid()) {
|
if (!m_algorithm.isValid()) {
|
||||||
m_algorithm.setAlgo(algorithm);
|
m_algorithm.setAlgo(algorithm);
|
||||||
|
|
||||||
|
# ifndef XMRIG_PROXY_PROJECT
|
||||||
if (m_algorithm.variant() == xmrig::VARIANT_AUTO) {
|
if (m_algorithm.variant() == xmrig::VARIANT_AUTO) {
|
||||||
if (algorithm == xmrig::CRYPTONIGHT_HEAVY) {
|
if (algorithm == xmrig::CRYPTONIGHT_HEAVY) {
|
||||||
m_algorithm.setVariant(xmrig::VARIANT_0);
|
m_algorithm.setVariant(xmrig::VARIANT_0);
|
||||||
|
@ -240,6 +241,7 @@ void Pool::adjust(xmrig::Algo algorithm)
|
||||||
m_algorithm.setVariant(xmrig::VARIANT_1);
|
m_algorithm.setVariant(xmrig::VARIANT_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(m_host.data(), ".nicehash.com")) {
|
if (strstr(m_host.data(), ".nicehash.com")) {
|
||||||
|
|
Loading…
Reference in a new issue