Merge branch 'dev' into feature-opencl
This commit is contained in:
commit
bd07f1d455
121 changed files with 5477 additions and 369 deletions
|
@ -40,7 +40,8 @@
|
|||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kCPU = "cpu";
|
||||
static const char *kCPU = "cpu";
|
||||
static constexpr const uint32_t kVersion = 1;
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
static const char *kRandomX = "randomx";
|
||||
|
@ -64,6 +65,10 @@ bool xmrig::Config::isShouldSave() const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (version() < kVersion) {
|
||||
return true;
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
if (m_cl.isShouldSave()) {
|
||||
return true;
|
||||
|
@ -80,7 +85,7 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
|
|||
return false;
|
||||
}
|
||||
|
||||
m_cpu.read(reader.getValue(kCPU));
|
||||
m_cpu.read(reader.getValue(kCPU), version());
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (!m_rx.read(reader.getValue(kRandomX))) {
|
||||
|
@ -105,12 +110,13 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
Value api(kObjectType);
|
||||
api.AddMember("id", m_apiId.toJSON(), allocator);
|
||||
api.AddMember("worker-id", m_apiWorkerId.toJSON(), allocator);
|
||||
api.AddMember("id", m_apiId.toJSON(), allocator);
|
||||
api.AddMember("worker-id", m_apiWorkerId.toJSON(), allocator);
|
||||
|
||||
doc.AddMember("api", api, allocator);
|
||||
doc.AddMember("http", m_http.toJSON(doc), allocator);
|
||||
doc.AddMember("autosave", isAutoSave(), allocator);
|
||||
doc.AddMember("version", kVersion, allocator);
|
||||
doc.AddMember("background", isBackground(), allocator);
|
||||
doc.AddMember("colors", Log::colors, allocator);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue