Merge pull request #60 from Spudz76/ocean-master-fixAsteriskProfile

Fix --threads generates "*" profile without "kawpow":false to negate it.
This commit is contained in:
MoneroOcean 2021-06-01 00:20:22 +00:00 committed by GitHub
commit 62b422d5b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -266,7 +266,7 @@ bool xmrig::CpuBackend::isEnabled() const
bool xmrig::CpuBackend::isEnabled(const Algorithm &algorithm) const bool xmrig::CpuBackend::isEnabled(const Algorithm &algorithm) const
{ {
return !d_ptr->controller->config()->cpu().threads().get(algorithm).isEmpty(); return algorithm.isValid() && !d_ptr->controller->config()->cpu().threads().get(algorithm).isEmpty();
} }

View file

@ -44,6 +44,9 @@ static const char *kAsterisk = "*";
static const char *kEnabled = "enabled"; static const char *kEnabled = "enabled";
static const char *kIntensity = "intensity"; static const char *kIntensity = "intensity";
static const char *kThreads = "threads"; static const char *kThreads = "threads";
#ifdef XMRIG_ALGO_KAWPOW
static const char *kKawPow = "kawpow";
#endif
static inline uint64_t intensity(uint64_t av) static inline uint64_t intensity(uint64_t av)
@ -103,6 +106,9 @@ void xmrig::ConfigTransform::finalize(rapidjson::Document &doc)
profile.AddMember(StringRef(kThreads), m_threads, allocator); profile.AddMember(StringRef(kThreads), m_threads, allocator);
profile.AddMember(StringRef(kAffinity), m_affinity, allocator); profile.AddMember(StringRef(kAffinity), m_affinity, allocator);
# ifdef XMRIG_ALGO_KAWPOW
doc[CpuConfig::kField].AddMember(StringRef(kKawPow), false, doc.GetAllocator());
# endif
doc[CpuConfig::kField].AddMember(StringRef(kAsterisk), profile, doc.GetAllocator()); doc[CpuConfig::kField].AddMember(StringRef(kAsterisk), profile, doc.GetAllocator());
} }