mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-17 00:07:44 +00:00
Sync changes with proxy.
This commit is contained in:
parent
2b0309e159
commit
9c23186172
3 changed files with 33 additions and 28 deletions
|
@ -123,6 +123,11 @@ void xmrig::Algorithm::parseAlgorithm(const char *algo)
|
|||
m_algo = INVALID_ALGO;
|
||||
m_variant = VARIANT_AUTO;
|
||||
|
||||
assert(algo != nullptr);
|
||||
if (algo == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(algorithms); i++) {
|
||||
if ((strcasecmp(algo, algorithms[i].name) == 0) || (strcasecmp(algo, algorithms[i].shortName) == 0)) {
|
||||
m_algo = algorithms[i].algo;
|
||||
|
@ -182,6 +187,11 @@ void xmrig::Algorithm::parseXmrStakAlgorithm(const char *algo)
|
|||
m_algo = INVALID_ALGO;
|
||||
m_variant = VARIANT_AUTO;
|
||||
|
||||
assert(algo != nullptr);
|
||||
if (algo == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(xmrStakAlgorithms); i++) {
|
||||
if (strcasecmp(algo, xmrStakAlgorithms[i].name) == 0) {
|
||||
m_algo = xmrStakAlgorithms[i].algo;
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
#define ADD_VARIANT(variant) m_algorithms.push_back(xmrig::Algorithm(m_algorithm.algo(), variant));
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define strncasecmp _strnicmp
|
||||
# define strcasecmp _stricmp
|
||||
|
@ -240,32 +237,15 @@ void Pool::adjust(xmrig::Algo algorithm)
|
|||
m_algorithm.setVariant(xmrig::VARIANT_1);
|
||||
}
|
||||
|
||||
# ifndef XMRIG_PROXY_PROJECT
|
||||
switch (m_algorithm.algo()) {
|
||||
case xmrig::CRYPTONIGHT:
|
||||
ADD_VARIANT(xmrig::VARIANT_AUTO);
|
||||
ADD_VARIANT(xmrig::VARIANT_0);
|
||||
ADD_VARIANT(xmrig::VARIANT_1);
|
||||
ADD_VARIANT(xmrig::VARIANT_XTL);
|
||||
break;
|
||||
|
||||
case xmrig::CRYPTONIGHT_LITE:
|
||||
ADD_VARIANT(xmrig::VARIANT_AUTO);
|
||||
ADD_VARIANT(xmrig::VARIANT_0);
|
||||
ADD_VARIANT(xmrig::VARIANT_1);
|
||||
ADD_VARIANT(xmrig::VARIANT_IPBC);
|
||||
break;
|
||||
|
||||
case xmrig::CRYPTONIGHT_HEAVY:
|
||||
ADD_VARIANT(xmrig::VARIANT_0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
# else
|
||||
m_algorithms.push_back(m_algorithm);
|
||||
# endif
|
||||
|
||||
if (m_algorithm.algo() != xmrig::CRYPTONIGHT_HEAVY) {
|
||||
addVariant(xmrig::VARIANT_1);
|
||||
addVariant(xmrig::VARIANT_0);
|
||||
addVariant(xmrig::VARIANT_XTL);
|
||||
addVariant(xmrig::VARIANT_IPBC);
|
||||
addVariant(xmrig::VARIANT_AUTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -306,3 +286,14 @@ bool Pool::parseIPv6(const char *addr)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Pool::addVariant(xmrig::Variant variant)
|
||||
{
|
||||
const xmrig::Algorithm algorithm(m_algorithm.algo(), variant);
|
||||
if (!algorithm.isValid() || m_algorithm == algorithm) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_algorithms.push_back(algorithm);
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ public:
|
|||
|
||||
private:
|
||||
bool parseIPv6(const char *addr);
|
||||
void addVariant(xmrig::Variant variant);
|
||||
|
||||
bool m_nicehash;
|
||||
int m_keepAlive;
|
||||
|
@ -98,4 +99,7 @@ private:
|
|||
xmrig::c_str m_user;
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<Pool> Pools;
|
||||
|
||||
#endif /* __POOL_H__ */
|
||||
|
|
Loading…
Reference in a new issue