Merge commit

This commit is contained in:
MoneroOcean 2019-07-28 11:38:00 -07:00
commit c0fec3db63
100 changed files with 33836 additions and 231 deletions

View file

@ -38,6 +38,17 @@
#include "rapidjson/prettywriter.h"
namespace xmrig {
static const char *kCPU = "cpu";
#ifdef XMRIG_ALGO_RANDOMX
static const char *kRandomX = "randomx";
#endif
}
xmrig::Config::Config() : BaseConfig()
{
}
@ -49,9 +60,15 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
return false;
}
m_cpu.read(reader.getValue("cpu"));
m_cpu.read(reader.getValue(kCPU));
m_benchmark.read(reader.getValue("algo-perf"));
# ifdef XMRIG_ALGO_RANDOMX
if (!m_rx.read(reader.getValue(kRandomX))) {
m_upgrade = true;
}
# endif
return true;
}
@ -69,14 +86,19 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
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("background", isBackground(), allocator);
doc.AddMember("colors", Log::colors, allocator);
doc.AddMember("cpu", m_cpu.toJSON(doc), allocator);
# ifdef XMRIG_ALGO_RANDOMX
doc.AddMember(StringRef(kRandomX), m_rx.toJSON(doc), allocator);
# endif
doc.AddMember(StringRef(kCPU), m_cpu.toJSON(doc), allocator);
doc.AddMember("algo-perf", m_benchmark.toJSON(doc), allocator);
doc.AddMember("donate-level", m_pools.donateLevel(), allocator);
doc.AddMember("donate-over-proxy", m_pools.proxyDonate(), allocator);
doc.AddMember("http", m_http.toJSON(doc), allocator);
doc.AddMember("log-file", m_logFile.toJSON(), allocator);
doc.AddMember("pools", m_pools.toJSON(doc), allocator);
doc.AddMember("print-time", printTime(), allocator);