Added option to disable Monero v7 PoW, may useful in future if other coins update their network to v7 without PoW change.

This commit is contained in:
XMRig 2018-03-07 19:12:18 +07:00
parent 8a6988d381
commit 69b8a4faf1
7 changed files with 34 additions and 11 deletions

View file

@ -37,12 +37,13 @@
class Job
{
public:
Job(int poolId = -2, bool nicehash = false);
Job(int poolId = -2, bool nicehash = false, bool monero = true);
~Job();
bool setBlob(const char *blob);
bool setTarget(const char *target);
inline bool isMonero() const { return m_monero; }
inline bool isNicehash() const { return m_nicehash; }
inline bool isValid() const { return m_size > 0 && m_diff > 0; }
inline bool setId(const char *id) { return m_id.setId(id); }
@ -55,7 +56,7 @@ public:
inline uint32_t *nonce() { return reinterpret_cast<uint32_t*>(m_blob + 39); }
inline uint32_t diff() const { return (uint32_t) m_diff; }
inline uint64_t target() const { return m_target; }
inline uint8_t version() const { return m_blob[0]; }
inline uint8_t version() const { return isMonero() ? m_blob[0] : 0; }
inline void setNicehash(bool nicehash) { m_nicehash = nicehash; }
inline void setThreadId(int threadId) { m_threadId = threadId; }
@ -74,6 +75,7 @@ public:
private:
VAR_ALIGN(16, uint8_t m_blob[84]); // Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk.
bool m_monero;
bool m_nicehash;
int m_poolId;
int m_threadId;