Added initial support for per pool algo option (mining code is broken).

This commit is contained in:
XMRig 2019-06-10 20:46:29 +07:00
parent 725c767928
commit d7f42d54ad
18 changed files with 187 additions and 637 deletions

View file

@ -34,10 +34,8 @@
xmrig::Job::Job() :
m_autoVariant(false),
m_nicehash(false),
m_poolId(-2),
m_threadId(-1),
m_size(0),
m_diff(0),
m_height(0),
@ -49,10 +47,8 @@ xmrig::Job::Job() :
xmrig::Job::Job(int poolId, bool nicehash, const Algorithm &algorithm, const String &clientId) :
m_algorithm(algorithm),
m_autoVariant(algorithm.variant() == VARIANT_AUTO),
m_nicehash(nicehash),
m_poolId(poolId),
m_threadId(-1),
m_size(0),
m_clientId(clientId),
m_diff(0),
@ -98,10 +94,6 @@ bool xmrig::Job::setBlob(const char *blob)
m_nicehash = true;
}
if (m_autoVariant) {
m_algorithm.setVariant(variant());
}
# ifdef XMRIG_PROXY_PROJECT
memset(m_rawBlob, 0, sizeof(m_rawBlob));
memcpy(m_rawBlob, blob, m_size * 2);
@ -153,16 +145,6 @@ bool xmrig::Job::setTarget(const char *target)
}
void xmrig::Job::setAlgorithm(const char *algo)
{
m_algorithm.parseAlgorithm(algo);
if (m_algorithm.variant() == xmrig::VARIANT_AUTO) {
m_algorithm.setVariant(variant());
}
}
void xmrig::Job::setDiff(uint64_t diff)
{
m_diff = diff;
@ -173,23 +155,3 @@ void xmrig::Job::setDiff(uint64_t diff)
m_rawTarget[16] = '\0';
# endif
}
xmrig::Variant xmrig::Job::variant() const
{
switch (m_algorithm.algo()) {
case CRYPTONIGHT:
return (m_blob[0] >= 10) ? VARIANT_4 : ((m_blob[0] >= 8) ? VARIANT_2 : VARIANT_1);
case CRYPTONIGHT_LITE:
return VARIANT_1;
case CRYPTONIGHT_HEAVY:
return VARIANT_0;
default:
break;
}
return m_algorithm.variant();
}