Removed m_bench field from Job class.
This commit is contained in:
parent
36b1523194
commit
7fc7b976bf
19 changed files with 44 additions and 68 deletions
|
@ -174,10 +174,6 @@ void xmrig::Job::copy(const Job &other)
|
|||
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
|
||||
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
m_bench = other.m_bench;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,8 +205,4 @@ void xmrig::Job::move(Job &&other)
|
|||
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
|
||||
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
m_bench = other.m_bench;
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -111,11 +111,6 @@ public:
|
|||
inline Job &operator=(const Job &other) { copy(other); return *this; }
|
||||
inline Job &operator=(Job &&other) noexcept { move(std::move(other)); return *this; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
inline uint32_t bench() const { return m_bench; }
|
||||
inline void setBench(uint32_t bench) { m_bench = bench; }
|
||||
# endif
|
||||
|
||||
private:
|
||||
void copy(const Job &other);
|
||||
void move(Job &&other);
|
||||
|
@ -140,10 +135,6 @@ private:
|
|||
char m_rawTarget[24]{};
|
||||
String m_rawSeedHash;
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
uint32_t m_bench = 0;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -59,5 +59,4 @@ void xmrig::NullClient::setPool(const Pool& pool)
|
|||
}
|
||||
|
||||
m_job.setAlgorithm(m_pool.algorithm().id());
|
||||
m_job.setBench(m_pool.benchSize());
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
inline void setUser(const String &user) { m_user = user; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
inline uint64_t benchSize() const { return m_benchSize; }
|
||||
inline uint32_t benchSize() const { return m_benchSize; }
|
||||
# endif
|
||||
|
||||
inline bool operator!=(const Pool &other) const { return !isEqual(other); }
|
||||
|
|
|
@ -65,18 +65,6 @@ bool xmrig::Pools::isEqual(const Pools &other) const
|
|||
}
|
||||
|
||||
|
||||
int xmrig::Pools::donateLevel() const
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
if (m_data.size() == 1 && m_data.front().mode() == Pool::MODE_BENCHMARK) {
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
return m_donateLevel;
|
||||
}
|
||||
|
||||
|
||||
xmrig::IStrategy *xmrig::Pools::createStrategy(IStrategyListener *listener) const
|
||||
{
|
||||
if (active() == 1) {
|
||||
|
@ -153,6 +141,18 @@ void xmrig::Pools::load(const IJsonReader &reader)
|
|||
}
|
||||
|
||||
|
||||
uint32_t xmrig::Pools::benchSize() const
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
if (m_data.size() == 1 && m_data.front().mode() == Pool::MODE_BENCHMARK) {
|
||||
return m_data.front().benchSize();
|
||||
}
|
||||
# endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Pools::print() const
|
||||
{
|
||||
size_t i = 1;
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
Pools();
|
||||
|
||||
inline const std::vector<Pool> &data() const { return m_data; }
|
||||
inline int donateLevel() const { return benchSize() ? 0 : m_donateLevel; }
|
||||
inline int retries() const { return m_retries; }
|
||||
inline int retryPause() const { return m_retryPause; }
|
||||
inline ProxyDonate proxyDonate() const { return m_proxyDonate; }
|
||||
|
@ -66,10 +67,10 @@ public:
|
|||
inline bool operator==(const Pools &other) const { return isEqual(other); }
|
||||
|
||||
bool isEqual(const Pools &other) const;
|
||||
int donateLevel() const;
|
||||
IStrategy *createStrategy(IStrategyListener *listener) const;
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
size_t active() const;
|
||||
uint32_t benchSize() const;
|
||||
void load(const IJsonReader &reader);
|
||||
void print() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue