mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-23 14:52:52 -05:00
Fixed command line config and removed --max-cpu-usage and --safe.
This commit is contained in:
@@ -28,6 +28,15 @@
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static const char *kAsterisk = "*";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
template <class T>
|
||||
const std::vector<T> &xmrig::Threads<T>::get(const String &profileName) const
|
||||
{
|
||||
@@ -41,34 +50,7 @@ const std::vector<T> &xmrig::Threads<T>::get(const String &profileName) const
|
||||
|
||||
|
||||
template <class T>
|
||||
xmrig::String xmrig::Threads<T>::profileName(const Algorithm &algorithm, bool strict) const
|
||||
{
|
||||
if (isDisabled(algorithm)) {
|
||||
return String();
|
||||
}
|
||||
|
||||
const String name = algorithm.shortName();
|
||||
if (has(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
if (m_aliases.count(algorithm) > 0) {
|
||||
return m_aliases.at(algorithm);
|
||||
}
|
||||
|
||||
if (!strict && name.contains("/")) {
|
||||
const String base = name.split('/').at(0);
|
||||
if (has(base)) {
|
||||
return base;
|
||||
}
|
||||
}
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void xmrig::Threads<T>::read(const rapidjson::Value &value)
|
||||
size_t xmrig::Threads<T>::read(const rapidjson::Value &value)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
||||
@@ -109,6 +91,43 @@ void xmrig::Threads<T>::read(const rapidjson::Value &value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return m_profiles.size();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
xmrig::String xmrig::Threads<T>::profileName(const Algorithm &algorithm, bool strict) const
|
||||
{
|
||||
if (isDisabled(algorithm)) {
|
||||
return String();
|
||||
}
|
||||
|
||||
const String name = algorithm.shortName();
|
||||
if (has(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
if (m_aliases.count(algorithm) > 0) {
|
||||
return m_aliases.at(algorithm);
|
||||
}
|
||||
|
||||
if (strict) {
|
||||
return String();
|
||||
}
|
||||
|
||||
if (name.contains("/")) {
|
||||
const String base = name.split('/').at(0);
|
||||
if (has(base)) {
|
||||
return base;
|
||||
}
|
||||
}
|
||||
|
||||
if (has(kAsterisk)) {
|
||||
return kAsterisk;
|
||||
}
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
inline void move(const char *profile, std::vector<T> &&threads) { m_profiles.insert({ profile, threads }); }
|
||||
|
||||
const std::vector<T> &get(const String &profileName) const;
|
||||
size_t read(const rapidjson::Value &value);
|
||||
String profileName(const Algorithm &algorithm, bool strict = false) const;
|
||||
void read(const rapidjson::Value &value);
|
||||
void toJSON(rapidjson::Value &out, rapidjson::Document &doc) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user