diff --git a/src/backend/common/Tags.h b/src/backend/common/Tags.h index 03cee729c2..0e29827595 100644 --- a/src/backend/common/Tags.h +++ b/src/backend/common/Tags.h @@ -46,10 +46,6 @@ const char *ocl_tag(); const char *cuda_tag(); #endif -#ifdef XMRIG_FEATURE_BENCHMARK -const char *bm_tag(); -#endif - } // namespace xmrig diff --git a/src/base/kernel/config/BaseConfig.cpp b/src/base/kernel/config/BaseConfig.cpp index 129c2d6660..f176e65bc4 100644 --- a/src/base/kernel/config/BaseConfig.cpp +++ b/src/base/kernel/config/BaseConfig.cpp @@ -101,12 +101,12 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName) m_autoSave = reader.getBool(kAutosave, m_autoSave); m_background = reader.getBool(kBackground, m_background); m_dryRun = reader.getBool(kDryRun, m_dryRun); + m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery); # ifdef XMRIG_FEATURE_BENCHMARK - m_rebenchAlgo = reader.getBool(kRebenchAlgo, m_rebenchAlgo); + m_rebenchAlgo = reader.getBool(kRebenchAlgo, m_rebenchAlgo); # endif m_syslog = reader.getBool(kSyslog, m_syslog); m_watch = reader.getBool(kWatch, m_watch); - m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery); m_logFile = reader.getString(kLogFile); m_userAgent = reader.getString(kUserAgent); m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U); diff --git a/src/base/kernel/config/BaseTransform.cpp b/src/base/kernel/config/BaseTransform.cpp index 272e1d71e3..5d34a71204 100644 --- a/src/base/kernel/config/BaseTransform.cpp +++ b/src/base/kernel/config/BaseTransform.cpp @@ -256,10 +256,10 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch case IConfig::DaemonKey: /* --daemon */ # endif case IConfig::VerboseKey: /* --verbose */ + case IConfig::PauseOnBatteryKey: /* --pause-on-battery */ # ifdef XMRIG_FEATURE_BENCHMARK case IConfig::RebenchAlgoKey: /* --rebench-algo */ # endif - case IConfig::PauseOnBatteryKey: /* --pause-on-battery */ return transformBoolean(doc, key, true); case IConfig::ColorKey: /* --no-color */ @@ -318,14 +318,14 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b case IConfig::NoTitleKey: /* --no-title */ return set(doc, BaseConfig::kTitle, enable); + case IConfig::PauseOnBatteryKey: /* --pause-on-battery */ + return set(doc, BaseConfig::kPauseOnBattery, enable); + # ifdef XMRIG_FEATURE_BENCHMARK case IConfig::RebenchAlgoKey: /* --rebench-algo */ return set(doc, BaseConfig::kRebenchAlgo, enable); # endif - case IConfig::PauseOnBatteryKey: /* --pause-on-battery */ - return set(doc, BaseConfig::kPauseOnBattery, enable); - default: break; } diff --git a/src/config.json b/src/config.json index 2232d563bc..843ab94d49 100644 --- a/src/config.json +++ b/src/config.json @@ -92,7 +92,7 @@ "user-agent": null, "verbose": 0, "watch": true, + "pause-on-battery": false, "rebench-algo": false, - "bench-algo-time": 20, - "pause-on-battery": false + "bench-algo-time": 20 } diff --git a/src/core/Benchmark.cpp b/src/core/Benchmark.cpp index 5966833883..3da50ebdfd 100644 --- a/src/core/Benchmark.cpp +++ b/src/core/Benchmark.cpp @@ -229,8 +229,3 @@ uint64_t Benchmark::get_now() const { // get current time in ms } } // namespace xmrig - -const char *xmrig::bm_tag() -{ - return Tags::benchmark(); -} diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 3b76363993..d10b9a077f 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -262,12 +262,11 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const doc.AddMember(StringRef(kUserAgent), m_userAgent.toJSON(), allocator); doc.AddMember(StringRef(kVerbose), Log::verbose(), allocator); doc.AddMember(StringRef(kWatch), m_watch, allocator); + doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator); # ifdef XMRIG_FEATURE_BENCHMARK doc.AddMember(StringRef(kRebenchAlgo), isRebenchAlgo(), allocator); doc.AddMember(StringRef(kBenchAlgoTime), benchAlgoTime(), allocator); doc.AddMember(StringRef(kAlgoPerf), m_benchmark.toJSON(doc), allocator); # endif - - doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator); } diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index 12b83dbee7..7681530906 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -595,7 +595,7 @@ extern "C" { alignas(16) uint64_t tempHash[8]; switch (algo) { case xmrig::Algorithm::RX_DEFYX: rx_sipesh_k12(tempHash, sizeof(tempHash), input, inputSize); break; - case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), input, inputSize); break; + case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), input, inputSize); break; default: rx_blake2b(tempHash, sizeof(tempHash), input, inputSize, nullptr, 0); } machine->initScratchpad(&tempHash); @@ -611,7 +611,7 @@ extern "C" { void randomx_calculate_hash_first(randomx_vm* machine, uint64_t (&tempHash)[8], const void* input, size_t inputSize, const xmrig::Algorithm algo) { switch (algo) { case xmrig::Algorithm::RX_DEFYX: rx_sipesh_k12(tempHash, sizeof(tempHash), input, inputSize); break; - case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), input, inputSize); break; + case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), input, inputSize); break; default: rx_blake2b(tempHash, sizeof(tempHash), input, inputSize, nullptr, 0); } machine->initScratchpad(tempHash); @@ -628,7 +628,7 @@ extern "C" { // Finish current hash and fill the scratchpad for the next hash at the same time switch (algo) { case xmrig::Algorithm::RX_DEFYX: rx_sipesh_k12(tempHash, sizeof(tempHash), nextInput, nextInputSize); break; - case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), nextInput, nextInputSize); break; + case xmrig::Algorithm::RX_XLA: rx_yespower_k12(tempHash, sizeof(tempHash), nextInput, nextInputSize); break; default: rx_blake2b(tempHash, sizeof(tempHash), nextInput, nextInputSize, nullptr, 0); } machine->hashAndFill(output, RANDOMX_HASH_SIZE, tempHash);