Fixed command line options for single pool, free order allowed again.

This commit is contained in:
XMRig 2019-08-31 06:18:32 +07:00
parent 53a71f7226
commit 13e38df391
3 changed files with 22 additions and 5 deletions

View file

@ -6,6 +6,7 @@
- [#1146](https://github.com/xmrig/xmrig/pull/1146) Fixed race condition in RandomX thread init.
- [#1148](https://github.com/xmrig/xmrig/pull/1148) Fixed, on Linux linker marking entire executable as having an executable stack.
- Fixed, for Argon2 algorithms command line options like `--threads` was ignored.
- Fixed command line options for single pool, free order allowed again.
# v3.1.0
- [#1107](https://github.com/xmrig/xmrig/issues/1107#issuecomment-522235892) Added Argon2 algorithm family: `argon2/chukwa` and `argon2/wrkz`.

View file

@ -33,11 +33,12 @@
#endif
#include "base/kernel/config/BaseTransform.h"
#include "base/kernel/Process.h"
#include "base/io/log/Log.h"
#include "base/kernel/interfaces/IConfig.h"
#include "base/io/json/JsonChain.h"
#include "base/io/log/Log.h"
#include "base/kernel/config/BaseTransform.h"
#include "base/kernel/interfaces/IConfig.h"
#include "base/kernel/Process.h"
#include "base/net/stratum/Pool.h"
#include "core/config/Config_platform.h"
@ -138,7 +139,19 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
break;
case IConfig::UrlKey: /* --url */
return add(doc, kPools, "url", arg, true);
{
if (!doc.HasMember(kPools)) {
doc.AddMember(rapidjson::StringRef(kPools), rapidjson::kArrayType, doc.GetAllocator());
}
rapidjson::Value &array = doc[kPools];
if (array.Size() == 0 || Pool(array[array.Size() - 1]).isValid()) {
array.PushBack(rapidjson::kObjectType, doc.GetAllocator());
}
set(doc, array[array.Size() - 1], "url", arg);
break;
}
case IConfig::UserKey: /* --user */
return add(doc, kPools, "user", arg);

View file

@ -200,6 +200,9 @@ bool xmrig::Pool::isEqual(const Pool &other) const
bool xmrig::Pool::parse(const char *url)
{
assert(url != nullptr);
if (url == nullptr) {
return false;
}
const char *p = strstr(url, "://");
const char *base = url;