From df90b299f27ccc7fecc616d5d659b048f2bbeb92 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 30 Aug 2019 18:55:53 +0700 Subject: [PATCH 1/5] Fixed, for Argon2 algorithms command line options, like `--threads` was ignored. --- CHANGELOG.md | 1 + src/core/config/ConfigTransform.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7507b7f4..d6efd0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#1142](https://github.com/xmrig/xmrig/pull/1142) RandomX hashrate improved by 0.5-1.5% depending on variant and CPU. - [#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. # v3.1.0 - [#1107](https://github.com/xmrig/xmrig/issues/1107#issuecomment-522235892) Added Argon2 algorithm family: `argon2/chukwa` and `argon2/wrkz`. diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index 622855af..ce0d324c 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -96,6 +96,8 @@ void xmrig::ConfigTransform::finalize(rapidjson::Document &doc) BaseTransform::finalize(doc); if (m_threads) { + doc.AddMember("version", 1, allocator); + if (!doc.HasMember(kCpu)) { doc.AddMember(StringRef(kCpu), Value(kObjectType), allocator); } From 53a71f72266360ca55dfd126241c0ea96dc9e772 Mon Sep 17 00:00:00 2001 From: xmrig Date: Fri, 30 Aug 2019 19:16:05 +0700 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6efd0f8..6ca3d363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - [#1142](https://github.com/xmrig/xmrig/pull/1142) RandomX hashrate improved by 0.5-1.5% depending on variant and CPU. - [#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, for Argon2 algorithms command line options like `--threads` was ignored. # v3.1.0 - [#1107](https://github.com/xmrig/xmrig/issues/1107#issuecomment-522235892) Added Argon2 algorithm family: `argon2/chukwa` and `argon2/wrkz`. From 13e38df391da5e293293b51929ef70e5e82d4f9f Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 31 Aug 2019 06:18:32 +0700 Subject: [PATCH 3/5] Fixed command line options for single pool, free order allowed again. --- CHANGELOG.md | 1 + src/base/kernel/config/BaseTransform.cpp | 23 ++++++++++++++++++----- src/base/net/stratum/Pool.cpp | 3 +++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca3d363..a5604822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/src/base/kernel/config/BaseTransform.cpp b/src/base/kernel/config/BaseTransform.cpp index 8043c6e9..12e7d848 100644 --- a/src/base/kernel/config/BaseTransform.cpp +++ b/src/base/kernel/config/BaseTransform.cpp @@ -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); diff --git a/src/base/net/stratum/Pool.cpp b/src/base/net/stratum/Pool.cpp index 4d15ea47..ba31c35d 100644 --- a/src/base/net/stratum/Pool.cpp +++ b/src/base/net/stratum/Pool.cpp @@ -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; From 5439f2d7b85c3ea878e061b37afafae78666c069 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 31 Aug 2019 07:54:09 +0700 Subject: [PATCH 4/5] v3.1.1 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 3cb05a7d..fdd4c7dc 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig CPU miner" -#define APP_VERSION "3.1.1-dev" +#define APP_VERSION "3.1.1" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" From f1a9302c3e4176548f0b0da998fbc5ba9db089a8 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 31 Aug 2019 08:29:15 +0700 Subject: [PATCH 5/5] v3.1.2-dev --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index fdd4c7dc..a0c461cf 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig CPU miner" -#define APP_VERSION "3.1.1" +#define APP_VERSION "3.1.2-dev" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 3 #define APP_VER_MINOR 1 -#define APP_VER_PATCH 1 +#define APP_VER_PATCH 2 #ifdef _MSC_VER # if (_MSC_VER >= 1920)