summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-05-03 22:44:47 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2018-06-04 21:07:11 +0000
commitf2f2f8a77a113834a6fe4ffbac28a1415d60e6ae (patch)
tree0abc253a0e617d61f5e827707086d62401a959d7
parentd7ef42215316ebb892042a207fd42fa6bbc13135 (diff)
downloadxmr-stak-f2f2f8a77a113834a6fe4ffbac28a1415d60e6ae.zip
xmr-stak-f2f2f8a77a113834a6fe4ffbac28a1415d60e6ae.tar.gz
set correct `iPoolId` for miner_work
- initialize miner_work iPoolId in the default constructor with the invalid pool id - move definition of `pool_data` into an own file
-rw-r--r--xmrstak/backend/globalStates.hpp15
-rw-r--r--xmrstak/backend/miner_work.hpp4
-rw-r--r--xmrstak/backend/pool_data.hpp21
3 files changed, 26 insertions, 14 deletions
diff --git a/xmrstak/backend/globalStates.hpp b/xmrstak/backend/globalStates.hpp
index fafd232..e1b554f 100644
--- a/xmrstak/backend/globalStates.hpp
+++ b/xmrstak/backend/globalStates.hpp
@@ -1,26 +1,15 @@
#pragma once
-#include "miner_work.hpp"
+#include "xmrstak/backend/miner_work.hpp"
#include "xmrstak/misc/environment.hpp"
#include "xmrstak/misc/console.hpp"
+#include "xmrstak/backend/pool_data.hpp"
#include <atomic>
-constexpr static size_t invalid_pool_id = (-1);
-
namespace xmrstak
{
-struct pool_data
-{
- uint32_t iSavedNonce;
- size_t pool_id;
-
- pool_data() : iSavedNonce(0), pool_id(invalid_pool_id)
- {
- }
-};
-
struct globalStates
{
static inline globalStates& inst()
diff --git a/xmrstak/backend/miner_work.hpp b/xmrstak/backend/miner_work.hpp
index 438ec0d..b6456f0 100644
--- a/xmrstak/backend/miner_work.hpp
+++ b/xmrstak/backend/miner_work.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "xmrstak/backend/pool_data.hpp"
+
#include <thread>
#include <atomic>
#include <mutex>
@@ -20,7 +22,7 @@ namespace xmrstak
bool bStall;
size_t iPoolId;
- miner_work() : iWorkSize(0), bNiceHash(false), bStall(true), iPoolId(0) { }
+ miner_work() : iWorkSize(0), bNiceHash(false), bStall(true), iPoolId(invalid_pool_id) { }
miner_work(const char* sJobID, const uint8_t* bWork, uint32_t iWorkSize,
uint64_t iTarget, bool bNiceHash, size_t iPoolId) : iWorkSize(iWorkSize),
diff --git a/xmrstak/backend/pool_data.hpp b/xmrstak/backend/pool_data.hpp
new file mode 100644
index 0000000..4e92359
--- /dev/null
+++ b/xmrstak/backend/pool_data.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+constexpr static size_t invalid_pool_id = (-1);
+
+namespace xmrstak
+{
+
+struct pool_data
+{
+ uint32_t iSavedNonce;
+ size_t pool_id;
+
+ pool_data() : iSavedNonce(0), pool_id(invalid_pool_id)
+ {
+ }
+};
+
+} // namespace xmrstak
OpenPOWER on IntegriCloud