diff --git a/src/common/net/Job.cpp b/src/common/net/Job.cpp index bb5f6a12..2bfb39f0 100644 --- a/src/common/net/Job.cpp +++ b/src/common/net/Job.cpp @@ -170,6 +170,16 @@ bool Job::setTarget(const char *target) } +void Job::setAlgorithm(const char *algo) +{ + m_algorithm.parseAlgorithm(algo); + + if (m_algorithm.variant() == xmrig::VARIANT_AUTO) { + m_algorithm.setVariant(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 8bd1b8ad..b561b9c1 100644 --- a/src/common/net/Job.h +++ b/src/common/net/Job.h @@ -44,6 +44,7 @@ public: bool setBlob(const char *blob); bool setTarget(const char *target); + void setAlgorithm(const char *algo); inline bool isNicehash() const { return m_nicehash; } inline bool isValid() const { return m_size > 0 && m_diff > 0; } @@ -60,7 +61,6 @@ public: inline uint32_t diff() const { return static_cast(m_diff); } inline uint64_t target() const { return m_target; } inline void reset() { m_size = 0; m_diff = 0; } - inline void setAlgorithm(const char *algo) { m_algorithm.parseAlgorithm(algo); } inline void setClientId(const xmrig::Id &id) { m_clientId = id; } inline void setPoolId(int poolId) { m_poolId = poolId; } inline void setThreadId(int threadId) { m_threadId = threadId; } diff --git a/src/common/xmrig.h b/src/common/xmrig.h index 3e1b65df..e1c7702e 100644 --- a/src/common/xmrig.h +++ b/src/common/xmrig.h @@ -21,8 +21,8 @@ * along with this program. If not, see . */ -#ifndef __XMRIG_H__ -#define __XMRIG_H__ +#ifndef XMRIG_XMRIG_H +#define XMRIG_XMRIG_H namespace xmrig @@ -85,7 +85,16 @@ enum AesMode { }; +enum OclVendor { + OCL_VENDOR_UNKNOWN = -2, + OCL_VENDOR_MANUAL = -1, + OCL_VENDOR_AMD = 0, + OCL_VENDOR_NVIDIA = 1, + OCL_VENDOR_INTEL = 2 +}; + + } /* namespace xmrig */ -#endif /* __XMRIG_H__ */ +#endif /* XMRIG_XMRIG_H */