diff --git a/src/common/net/Job.cpp b/src/common/net/Job.cpp index 34aab3262..81c3b8f8d 100644 --- a/src/common/net/Job.cpp +++ b/src/common/net/Job.cpp @@ -163,6 +163,28 @@ bool Job::setTarget(const char *target) } +xmrig::Variant Job::variant() const +{ + if (m_algorithm.algo() == xmrig::CRYPTONIGHT_HEAVY) { + return xmrig::VARIANT_0; + } + + if (m_algorithm.variant() == xmrig::VARIANT_XTL && m_blob[0] < 4) { + return xmrig::VARIANT_1; + } + + if (m_algorithm.variant() == xmrig::VARIANT_AUTO) { + if (m_algorithm.algo() == xmrig::CRYPTONIGHT) { + return xmrig::VARIANT_1; + } + + return (m_blob[0] > 6 ? xmrig::VARIANT_1 : xmrig::VARIANT_0); + } + + return m_algorithm.variant(); +} + + bool Job::fromHex(const char* in, unsigned int len, unsigned char* out) { bool error = false; diff --git a/src/common/net/Job.h b/src/common/net/Job.h index 08d5ae82b..049eb7d4d 100644 --- a/src/common/net/Job.h +++ b/src/common/net/Job.h @@ -43,6 +43,7 @@ public: bool setBlob(const char *blob); bool setTarget(const char *target); + xmrig::Variant variant() const; inline bool isNicehash() const { return m_nicehash; } inline bool isValid() const { return m_size > 0 && m_diff > 0; } @@ -64,11 +65,6 @@ public: inline void setThreadId(int threadId) { m_threadId = threadId; } inline xmrig::Algorithm &algorithm() { return m_algorithm; } - inline xmrig::Variant variant() const - { - return (m_algorithm.variant() == xmrig::VARIANT_AUTO ? (m_blob[0] > 6 ? xmrig::VARIANT_1 : xmrig::VARIANT_0) : m_algorithm.variant()); - } - # ifdef XMRIG_PROXY_PROJECT inline char *rawBlob() { return m_rawBlob; } inline const char *rawTarget() const { return m_rawTarget; }