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, ':');
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
|
||||
#include "base/kernel/interfaces/IConfigTransform.h"
|
||||
#include "crypto/common/Coin.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
|
@ -99,6 +100,7 @@ protected:
|
|||
|
||||
protected:
|
||||
Algorithm m_algorithm;
|
||||
Coin m_coin;
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
enum Keys {
|
||||
// common
|
||||
AlgorithmKey = 'a',
|
||||
CoinKey = 1025,
|
||||
ApiWorkerIdKey = 4002,
|
||||
ApiIdKey = 4005,
|
||||
HttpPort = 4100,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue