mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-24 12:39:28 +00:00
Sync changes with proxy.
This commit is contained in:
parent
be232fa1f2
commit
2b0309e159
4 changed files with 46 additions and 1 deletions
|
@ -71,6 +71,19 @@ static AlgoData const algorithms[] = {
|
|||
};
|
||||
|
||||
|
||||
#ifdef XMRIG_PROXY_PROJECT
|
||||
static AlgoData const xmrStakAlgorithms[] = {
|
||||
{ "cryptonight-monerov7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
||||
{ "cryptonight_v7", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_1 },
|
||||
{ "cryptonight_v7_stellite", nullptr, xmrig::CRYPTONIGHT, xmrig::VARIANT_XTL },
|
||||
{ "cryptonight_lite", nullptr, xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_0 },
|
||||
{ "cryptonight-aeonv7", 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 },
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
static const char *variants[] = {
|
||||
"0",
|
||||
"1",
|
||||
|
@ -163,6 +176,27 @@ void xmrig::Algorithm::setAlgo(Algo algo)
|
|||
}
|
||||
|
||||
|
||||
#ifdef XMRIG_PROXY_PROJECT
|
||||
void xmrig::Algorithm::parseXmrStakAlgorithm(const char *algo)
|
||||
{
|
||||
m_algo = INVALID_ALGO;
|
||||
m_variant = VARIANT_AUTO;
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(xmrStakAlgorithms); i++) {
|
||||
if (strcasecmp(algo, xmrStakAlgorithms[i].name) == 0) {
|
||||
m_algo = xmrStakAlgorithms[i].algo;
|
||||
m_variant = xmrStakAlgorithms[i].variant;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_algo == INVALID_ALGO) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
const char *xmrig::Algorithm::name(bool shortName) const
|
||||
{
|
||||
for (size_t i = 0; i < ARRAY_SIZE(algorithms); i++) {
|
||||
|
|
|
@ -49,6 +49,11 @@ public:
|
|||
setAlgo(algo);
|
||||
}
|
||||
|
||||
inline Algorithm(const char *algo)
|
||||
{
|
||||
parseAlgorithm(algo);
|
||||
}
|
||||
|
||||
bool isEqual(const Algorithm &other) const { return m_algo == other.m_algo && m_variant == other.m_variant; }
|
||||
inline Algo algo() const { return m_algo; }
|
||||
inline const char *name() const { return name(false); }
|
||||
|
@ -66,6 +71,10 @@ public:
|
|||
void parseVariant(int variant);
|
||||
void setAlgo(Algo algo);
|
||||
|
||||
# ifdef XMRIG_PROXY_PROJECT
|
||||
void parseXmrStakAlgorithm(const char *algo);
|
||||
# endif
|
||||
|
||||
private:
|
||||
const char *name(bool shortName) const;
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ private:
|
|||
};
|
||||
|
||||
|
||||
#define RED_BOLD(x) "\e[1;31m" x "\e[0m"
|
||||
#define RED(x) "\e[0;31m" x "\e[0m"
|
||||
#define GREEN_BOLD(x) "\e[1;32m" x "\e[0m"
|
||||
#define GREEN(x) "\e[0;32m" x "\e[0m"
|
||||
#define MAGENTA_BOLD(x) "\e[1;35m" x "\e[0m"
|
||||
|
|
|
@ -102,7 +102,7 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||
|
||||
Value pools(kArrayType);
|
||||
|
||||
for (const Pool &pool : m_pools) {
|
||||
for (const Pool &pool : m_activePools) {
|
||||
pools.PushBack(pool.toJSON(doc), allocator);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue