Merge branch 'dev' into feature-opencl

This commit is contained in:
XMRig 2019-08-17 23:33:48 +07:00
commit bd07f1d455
121 changed files with 5477 additions and 369 deletions

View file

@ -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);

View file

@ -45,6 +45,7 @@ R"===(
"restricted": true
},
"autosave": true,
"version": 1,
"background": false,
"colors": true,
"randomx": {
@ -57,6 +58,7 @@ R"===(
"hw-aes": null,
"priority": null,
"asm": true,
"argon2-impl": null,
"cn/0": false,
"cn-lite/0": false
},