mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-16 11:12:47 -05:00
Create pools directly from JSON objects.
This commit is contained in:
@@ -364,7 +364,10 @@ bool xmrig::CommonConfig::parseUint64(int key, uint64_t arg)
|
||||
|
||||
void xmrig::CommonConfig::parseJSON(const rapidjson::Document &doc)
|
||||
{
|
||||
|
||||
const rapidjson::Value &pools = doc["pools"];
|
||||
if (pools.IsArray()) {
|
||||
m_pools.load(pools);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -96,19 +96,6 @@ bool xmrig::ConfigLoader::loadFromJSON(xmrig::IConfig *config, const rapidjson::
|
||||
parseJSON(config, &config_options[i], doc);
|
||||
}
|
||||
|
||||
const rapidjson::Value &pools = doc["pools"];
|
||||
if (pools.IsArray()) {
|
||||
for (const rapidjson::Value &value : pools.GetArray()) {
|
||||
if (!value.IsObject()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(pool_options); i++) {
|
||||
parseJSON(config, &pool_options[i], value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rapidjson::Value &api = doc["api"];
|
||||
if (api.IsObject()) {
|
||||
for (size_t i = 0; i < ARRAY_SIZE(api_options); i++) {
|
||||
|
||||
Reference in New Issue
Block a user