xmrig v2.13.0 rebase

This commit is contained in:
MoneroOcean 2019-02-21 15:54:11 -08:00
commit cb22009ee5
111 changed files with 5210 additions and 1292 deletions

View file

@ -5,6 +5,7 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2019 MoneroOcean <https://github.com/MoneroOcean>, <support@moneroocean.stream>
*
@ -31,22 +32,25 @@
#include <vector>
#include "base/net/Pool.h"
#include "common/crypto/Algorithm.h"
#include "common/net/Id.h"
#include "common/net/Job.h"
#include "common/net/Pool.h"
#include "common/net/Storage.h"
#include "common/net/SubmitResult.h"
#include "rapidjson/fwd.h"
typedef struct bio_st BIO;
namespace xmrig {
class IClientListener;
class JobResult;
typedef struct bio_st BIO;
class Client
{
public:
@ -86,7 +90,7 @@ public:
inline int id() const { return m_id; }
inline SocketState state() const { return m_state; }
inline uint16_t port() const { return m_pool.port(); }
inline void setAlgo(const xmrig::Algorithm &algo) { m_pool.setAlgo(algo); }
inline void setAlgo(const Algorithm &algo) { m_pool.setAlgo(algo); }
inline void setQuiet(bool quiet) { m_quiet = quiet; }
inline void setRetries(int retries) { m_retries = retries; }
inline void setRetryPause(int ms) { m_retryPause = ms; }
@ -106,7 +110,7 @@ private:
bool parseJob(const rapidjson::Value &params, int *code);
bool parseLogin(const rapidjson::Value &result, int *code);
bool send(BIO *bio);
bool verifyAlgorithm(const xmrig::Algorithm &algorithm) const;
bool verifyAlgorithm(const Algorithm &algorithm) const;
int resolve(const char *host);
int64_t send(const rapidjson::Document &doc);
int64_t send(size_t size);
@ -163,11 +167,14 @@ private:
uv_getaddrinfo_t m_resolver;
uv_stream_t *m_stream;
uv_tcp_t *m_socket;
xmrig::Id m_rpcId;
Id m_rpcId;
static int64_t m_sequence;
static xmrig::Storage<Client> m_storage;
static Storage<Client> m_storage;
};
} /* namespace xmrig */
#endif /* XMRIG_CLIENT_H */