Merge xmrig v6.6.1 into master

This commit is contained in:
MoneroOcean 2020-11-26 03:57:41 +00:00
commit 821c04ed0e
15 changed files with 139 additions and 83 deletions

View file

@ -174,6 +174,10 @@ void xmrig::Job::copy(const Job &other)
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
m_benchSize = other.m_benchSize;
# endif
}
@ -205,4 +209,8 @@ void xmrig::Job::move(Job &&other)
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
m_benchSize = other.m_benchSize;
# endif
}

View file

@ -111,6 +111,11 @@ public:
inline Job &operator=(const Job &other) { copy(other); return *this; }
inline Job &operator=(Job &&other) noexcept { move(std::move(other)); return *this; }
# ifdef XMRIG_FEATURE_BENCHMARK
inline uint32_t benchSize() const { return m_benchSize; }
inline void setBenchSize(uint32_t size) { m_benchSize = size; }
# endif
private:
void copy(const Job &other);
void move(Job &&other);
@ -135,6 +140,10 @@ private:
char m_rawTarget[24]{};
String m_rawSeedHash;
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
uint32_t m_benchSize = 0;
# endif
};

View file

@ -51,8 +51,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
blob[Job::kMaxSeedSize * 2] = '\0';
m_job.setSeedHash(blob.data());
BenchState::setListener(this);
BenchState::setSize(m_benchmark->size());
BenchState::init(this, m_benchmark->size());
# ifdef XMRIG_FEATURE_HTTP
if (m_benchmark->isSubmit()) {
@ -75,6 +74,9 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
return;
}
m_job.setBenchSize(m_benchmark->size());
}
@ -219,6 +221,8 @@ bool xmrig::BenchClient::setSeed(const char *seed)
return false;
}
m_job.setBenchSize(BenchState::size());
LOG_NOTICE("%s " WHITE_BOLD("seed ") BLACK_BOLD("%s"), tag(), seed);
return true;
@ -286,11 +290,11 @@ void xmrig::BenchClient::onGetReply(const rapidjson::Value &value)
m_hash = strtoull(hash, nullptr, 16);
}
BenchState::setSize(Json::getUint(value, BenchConfig::kSize));
m_job.setAlgorithm(Json::getString(value, BenchConfig::kAlgo));
setSeed(Json::getString(value, BenchConfig::kSeed));
BenchState::setSize(Json::getUint(value, BenchConfig::kSize));
start();
}