From 37ee7ac66e41d0982ac8ff0e42ff0b3e5f21b50d Mon Sep 17 00:00:00 2001 From: Haifa Bogdan Adnan Date: Mon, 2 Sep 2019 12:47:44 +0300 Subject: [PATCH 1/4] Updating version path number --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index 272d8337..6a920838 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "ninjarig" #define APP_NAME "NinjaRig" #define APP_DESC "NinjaRig CPU/GPU miner" -#define APP_VERSION "1.0.0-dev" +#define APP_VERSION "1.0.1-dev" //#define APP_DOMAIN "xmrig.com" //#define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2019 Haifa Bogdan Adnan" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 1 #define APP_VER_MINOR 0 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1920) From 291e02adaff60b25c2fddbdb5d2fbfa79fa5d1a8 Mon Sep 17 00:00:00 2001 From: Haifa Bogdan Adnan Date: Mon, 2 Sep 2019 13:50:10 +0300 Subject: [PATCH 2/4] Fix for n/a hashrate in console. --- src/workers/Handle.cpp | 3 ++- src/workers/Handle.h | 5 +++-- src/workers/Workers.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/workers/Handle.cpp b/src/workers/Handle.cpp index cacaf636..14cf1b0d 100644 --- a/src/workers/Handle.cpp +++ b/src/workers/Handle.cpp @@ -26,7 +26,8 @@ #include "workers/Handle.h" -Handle::Handle(xmrig::Config *config, xmrig::HasherConfig *hasherConfig, uint32_t offset) : +Handle::Handle(int id, xmrig::Config *config, xmrig::HasherConfig *hasherConfig, uint32_t offset) : + m_id(id), m_offset(offset), m_config(config), m_hasherConfig(hasherConfig), diff --git a/src/workers/Handle.h b/src/workers/Handle.h index 50c7a2b4..f48f7e21 100644 --- a/src/workers/Handle.h +++ b/src/workers/Handle.h @@ -41,7 +41,7 @@ class IWorker; class Handle { public: - Handle(xmrig::Config *config, xmrig::HasherConfig *hasherConfig, uint32_t offset); + Handle(int id, xmrig::Config *config, xmrig::HasherConfig *hasherConfig, uint32_t offset); struct HandleArg { Handle *handle; @@ -52,7 +52,7 @@ public: void start(void (*callback) (void *)); inline std::vector &workers() { return m_workers; } - inline size_t hasherId() const { return m_hasherConfig->index(); } + inline size_t hasherId() const { return m_id; } inline size_t parallelism(int workerIdx) const { return m_hasher != nullptr ? m_hasher->parallelism(workerIdx) : 0; } inline size_t computingThreads() const { return m_hasher != nullptr ? m_hasher->computingThreads() : 0; } inline uint32_t offset() const { return m_offset; } @@ -61,6 +61,7 @@ public: inline Hasher *hasher() const { return m_hasher; } private: + int m_id; std::vector m_threads; std::vector m_workers; diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index d833a9f0..e4f9d250 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -167,7 +167,7 @@ bool Workers::start(xmrig::Controller *controller) uint32_t offset = 0; for (xmrig::HasherConfig *hasherConfig : hashers) { - Handle *handle = new Handle(controller->config(), hasherConfig, offset); + Handle *handle = new Handle((int)(m_workers.size()), controller->config(), hasherConfig, offset); if(handle->hasher() != nullptr) { offset += handle->computingThreads(); m_totalThreads += handle->computingThreads(); From 206f6784fd37e16943b4bd317b012eb10ec5eea1 Mon Sep 17 00:00:00 2001 From: Haifa Bogdan Adnan Date: Mon, 2 Sep 2019 14:11:15 +0300 Subject: [PATCH 3/4] Fix for crash on -B / --background option. --- src/App.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 0b69c884..903177f1 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -88,11 +88,11 @@ int xmrig::App::exec() m_signals = new Signals(this); - background(); - // load hasher modules Hasher::loadHashers(m_appFileName); + background(); + Summary::print(m_controller); if (m_controller->config()->isDryRun()) { From 4b24824f96e21243414da2893626199e788bc67c Mon Sep 17 00:00:00 2001 From: Haifa Bogdan Adnan Date: Mon, 2 Sep 2019 14:28:31 +0300 Subject: [PATCH 4/4] Fix for crash on -B / --background option - version 2. --- src/App.cpp | 4 ++-- src/App_unix.cpp | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 903177f1..0b69c884 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -88,11 +88,11 @@ int xmrig::App::exec() m_signals = new Signals(this); + background(); + // load hasher modules Hasher::loadHashers(m_appFileName); - background(); - Summary::print(m_controller); if (m_controller->config()->isDryRun()) { diff --git a/src/App_unix.cpp b/src/App_unix.cpp index 2b598c22..2979a41c 100644 --- a/src/App_unix.cpp +++ b/src/App_unix.cpp @@ -57,9 +57,4 @@ void xmrig::App::background() if (i < 0) { LOG_ERR("setsid() failed (errno = %d)", errno); } - - i = chdir("/"); - if (i < 0) { - LOG_ERR("chdir() failed (errno = %d)", errno); - } }