Removed --variant option, use --algo instead.

This commit is contained in:
XMRig 2019-07-20 05:24:21 +07:00
parent dc2c0552e0
commit 3fb180f04e
4 changed files with 24 additions and 12 deletions

View file

@ -44,6 +44,7 @@
namespace xmrig
{
static const char *kAlgo = "algo";
static const char *kApi = "api";
static const char *kHttp = "http";
static const char *kPools = "pools";
@ -100,7 +101,9 @@ void xmrig::BaseTransform::finalize(rapidjson::Document &doc)
if (m_algorithm.isValid() && doc.HasMember(kPools)) {
auto &pools = doc[kPools];
for (Value &pool : pools.GetArray()) {
pool.AddMember(StringRef("algo"), m_algorithm.toJSON(), allocator);
if (!pool.HasMember(kAlgo)) {
pool.AddMember(StringRef(kAlgo), m_algorithm.toJSON(), allocator);
}
}
}
}
@ -110,7 +113,12 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
{
switch (key) {
case IConfig::AlgorithmKey: /* --algo */
m_algorithm = arg;
if (!doc.HasMember(kPools)) {
m_algorithm = arg;
}
else {
return add(doc, kPools, kAlgo, arg);
}
break;
case IConfig::UserpassKey: /* --userpass */
@ -144,9 +152,6 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::FingerprintKey: /* --tls-fingerprint */
return add(doc, kPools, "tls-fingerprint", arg);
case IConfig::VariantKey: /* --variant */
return add(doc, kPools, "variant", arg);
case IConfig::LogFileKey: /* --log-file */
return set(doc, "log-file", arg);

View file

@ -65,7 +65,6 @@ public:
UserAgentKey = 1008,
UserKey = 'u',
UserpassKey = 'O',
VariantKey = 1010,
VerboseKey = 1100,
TlsKey = 1013,
FingerprintKey = 1014,

View file

@ -65,7 +65,6 @@ static const option options[] = {
{ "nicehash", 0, nullptr, IConfig::NicehashKey },
{ "no-color", 0, nullptr, IConfig::ColorKey },
{ "no-huge-pages", 0, nullptr, IConfig::HugePagesKey },
{ "variant", 1, nullptr, IConfig::VariantKey },
{ "pass", 1, nullptr, IConfig::PasswordKey },
{ "print-time", 1, nullptr, IConfig::PrintTimeKey },
{ "retries", 1, nullptr, IConfig::RetriesKey },

View file

@ -36,18 +36,28 @@ static char const usage[] = "\
Usage: " APP_ID " [OPTIONS]\n\
Options:\n\
-a, --algo=ALGO specify the algorithm to use\n\
cryptonight\n"
cn/r, cn/2, cn/1, cn/0, cn/double, cn/half, cn/fast,\n\
cn/rwz, cn/zls, cn/xao, cn/rto"
#ifdef XMRIG_ALGO_CN_GPU
", cn/gpu,\n"
#else
",\n"
#endif
#ifdef XMRIG_ALGO_CN_LITE
"\
cryptonight-lite\n"
cn-lite/1,\n"
#endif
#ifdef XMRIG_ALGO_CN_HEAVY
"\
cryptonight-heavy\n"
cn-heavy/xhv, cn-heavy/tube, cn-heavy/0,\n"
#endif
#ifdef XMRIG_ALGO_CN_PICO
"\
cryptonight-pico\n"
cn-pico,\n"
#endif
#ifdef XMRIG_ALGO_RANDOMX
"\
rx/wow, rx/loki\n"
#endif
"\
-o, --url=URL URL of mining server\n\
@ -76,7 +86,6 @@ Options:\n\
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n\
--no-huge-pages disable huge pages support\n\
--no-color disable colored output\n\
--variant algorithm PoW variant\n\
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n\
--user-agent set custom user-agent string for pool\n\
-B, --background run the miner in the background\n\