Fix for automatic variant specified by pool/proxy.

This commit is contained in:
XMRig 2018-09-22 15:54:31 +03:00
parent f1a1e0814c
commit 3a7e8647bb
3 changed files with 23 additions and 4 deletions

View file

@ -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 Job::fromHex(const char* in, unsigned int len, unsigned char* out)
{ {
bool error = false; bool error = false;

View file

@ -44,6 +44,7 @@ public:
bool setBlob(const char *blob); bool setBlob(const char *blob);
bool setTarget(const char *target); bool setTarget(const char *target);
void setAlgorithm(const char *algo);
inline bool isNicehash() const { return m_nicehash; } inline bool isNicehash() const { return m_nicehash; }
inline bool isValid() const { return m_size > 0 && m_diff > 0; } inline bool isValid() const { return m_size > 0 && m_diff > 0; }
@ -60,7 +61,6 @@ public:
inline uint32_t diff() const { return static_cast<uint32_t>(m_diff); } inline uint32_t diff() const { return static_cast<uint32_t>(m_diff); }
inline uint64_t target() const { return m_target; } inline uint64_t target() const { return m_target; }
inline void reset() { m_size = 0; m_diff = 0; } 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 setClientId(const xmrig::Id &id) { m_clientId = id; }
inline void setPoolId(int poolId) { m_poolId = poolId; } inline void setPoolId(int poolId) { m_poolId = poolId; }
inline void setThreadId(int threadId) { m_threadId = threadId; } inline void setThreadId(int threadId) { m_threadId = threadId; }

View file

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __XMRIG_H__ #ifndef XMRIG_XMRIG_H
#define __XMRIG_H__ #define XMRIG_XMRIG_H
namespace xmrig 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 */ } /* namespace xmrig */
#endif /* __XMRIG_H__ */ #endif /* XMRIG_XMRIG_H */