Added coin option.
This commit is contained in:
parent
cf6bd0e772
commit
e1d1a5226c
15 changed files with 227 additions and 5 deletions
|
@ -47,6 +47,7 @@ namespace xmrig
|
|||
|
||||
static const char *kAlgo = "algo";
|
||||
static const char *kApi = "api";
|
||||
static const char *kCoin = "coin";
|
||||
static const char *kHttp = "http";
|
||||
static const char *kPools = "pools";
|
||||
|
||||
|
@ -107,6 +108,15 @@ void xmrig::BaseTransform::finalize(rapidjson::Document &doc)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_coin.isValid() && doc.HasMember(kPools)) {
|
||||
auto &pools = doc[kPools];
|
||||
for (Value &pool : pools.GetArray()) {
|
||||
if (!pool.HasMember(kCoin)) {
|
||||
pool.AddMember(StringRef(kCoin), m_coin.toJSON(), allocator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,6 +132,15 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||
}
|
||||
break;
|
||||
|
||||
case IConfig::CoinKey: /* --coin */
|
||||
if (!doc.HasMember(kPools)) {
|
||||
m_coin = arg;
|
||||
}
|
||||
else {
|
||||
return add(doc, kPools, kCoin, arg);
|
||||
}
|
||||
break;
|
||||
|
||||
case IConfig::UserpassKey: /* --userpass */
|
||||
{
|
||||
const char *p = strrchr(arg, ':');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue