Implemented static benchmark verification (--bench --seed --hash)

This commit is contained in:
XMRig 2020-10-24 13:53:49 +07:00
parent 027a6f8ae2
commit 36c1cb23e0
No known key found for this signature in database
GPG key ID: 446A53638BE94409
14 changed files with 220 additions and 107 deletions

View file

@ -21,12 +21,13 @@
#include "base/net/stratum/Client.h"
#include "base/kernel/interfaces/IHttpListener.h"
namespace xmrig {
class BenchClient : public IClient
class BenchClient : public IClient, public IHttpListener
{
public:
XMRIG_DISABLE_COPY_MOVE_DEFAULT(BenchClient)
@ -63,12 +64,24 @@ public:
void connect() override;
void setPool(const Pool &pool) override;
protected:
void onHttpData(const HttpData &data) override;
private:
enum Mode : uint32_t {
STATIC_BENCH,
ONLINE_BENCH,
STATIC_VERIFY,
ONLINE_VERIFY
};
IClientListener* m_listener;
Job m_job;
Pool m_pool;
std::shared_ptr<BenchConfig> m_benchmark;
std::shared_ptr<IHttpListener> m_httpListener;
String m_ip;
Mode m_mode = STATIC_BENCH;
};