From df90b299f27ccc7fecc616d5d659b048f2bbeb92 Mon Sep 17 00:00:00 2001
From: XMRig <support@xmrig.com>
Date: Fri, 30 Aug 2019 18:55:53 +0700
Subject: [PATCH] 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 7507b7f4d..d6efd0f85 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 622855af6..ce0d324c7 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);
         }