Create pools directly from JSON objects.
This commit is contained in:
parent
3a0fdcac6f
commit
bdff4064a2
9 changed files with 76 additions and 47 deletions
|
@ -57,7 +57,7 @@ bool xmrig::Pools::setUrl(const char *url)
|
|||
Pool pool(url);
|
||||
|
||||
if (pool.isValid()) {
|
||||
m_data.push_back(pool);
|
||||
m_data.push_back(std::move(pool));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,23 @@ void xmrig::Pools::adjust(const Algorithm &algorithm)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::Pools::load(const rapidjson::Value &pools)
|
||||
{
|
||||
m_data.clear();
|
||||
|
||||
for (const rapidjson::Value &value : pools.GetArray()) {
|
||||
if (!value.IsObject()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Pool pool(value);
|
||||
if (pool.isValid()) {
|
||||
m_data.push_back(std::move(pool));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Pools::print()
|
||||
{
|
||||
size_t i = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue