libjansson replaced to rapidjson.

Sync changes with proxy.
This commit is contained in:
XMRig 2017-10-04 23:33:30 +03:00
parent 4cf3bb9930
commit af51513614
78 changed files with 15550 additions and 6420 deletions

View file

@ -25,31 +25,37 @@
#define __JOB_H__
#include <stddef.h>
#include <stdint.h>
#include "align.h"
#include "net/JobId.h"
class Job
{
public:
Job(int poolId = -2, bool nicehash = false);
~Job();
bool setBlob(const char *blob);
bool setId(const char *id);
bool setTarget(const char *target);
inline bool isNicehash() const { return m_nicehash; }
inline bool isValid() const { return m_size > 0 && m_diff > 0; }
inline const char *id() const { return m_id; }
inline bool setId(const char *id) { return m_id.setId(id); }
inline const JobId &id() const { return m_id; }
inline const uint32_t *nonce() const { return reinterpret_cast<const uint32_t*>(m_blob + 39); }
inline const uint8_t *blob() const { return m_blob; }
inline int poolId() const { return m_poolId; }
inline int threadId() const { return m_threadId; }
inline size_t size() const { return m_size; }
inline uint32_t *nonce() { return reinterpret_cast<uint32_t*>(m_blob + 39); }
inline uint32_t diff() const { return (uint32_t) m_diff; }
inline uint64_t target() const { return m_target; }
inline void setNicehash(bool nicehash) { m_nicehash = nicehash; }
inline void setThreadId(int threadId) { m_threadId = threadId; }
# ifdef XMRIG_PROXY_PROJECT
inline char *rawBlob() { return m_rawBlob; }
@ -66,11 +72,12 @@ public:
private:
bool m_nicehash;
int m_poolId;
VAR_ALIGN(16, char m_id[64]);
VAR_ALIGN(16, uint8_t m_blob[84]); // Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk.
int m_threadId;
JobId m_id;
size_t m_size;
uint64_t m_diff;
uint64_t m_target;
VAR_ALIGN(16, uint8_t m_blob[84]); // Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk.
# ifdef XMRIG_PROXY_PROJECT
VAR_ALIGN(16, char m_rawBlob[169]);