libjansson replaced to rapidjson.
Sync changes with proxy.
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "log/Log.h"
|
||||
#include "net/Job.h"
|
||||
|
||||
|
||||
@@ -59,6 +58,7 @@ static inline char hf_bin2hex(unsigned char c)
|
||||
Job::Job(int poolId, bool nicehash) :
|
||||
m_nicehash(nicehash),
|
||||
m_poolId(poolId),
|
||||
m_threadId(-1),
|
||||
m_size(0),
|
||||
m_diff(0),
|
||||
m_target(0)
|
||||
@@ -66,6 +66,11 @@ Job::Job(int poolId, bool nicehash) :
|
||||
}
|
||||
|
||||
|
||||
Job::~Job()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool Job::setBlob(const char *blob)
|
||||
{
|
||||
if (!blob) {
|
||||
@@ -99,18 +104,6 @@ bool Job::setBlob(const char *blob)
|
||||
}
|
||||
|
||||
|
||||
bool Job::setId(const char *id)
|
||||
{
|
||||
if (!id || strlen(id) >= sizeof(m_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(m_id, 0, sizeof(m_id));
|
||||
memcpy(m_id, id, strlen(id));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Job::setTarget(const char *target)
|
||||
{
|
||||
if (!target) {
|
||||
@@ -178,5 +171,5 @@ void Job::toHex(const unsigned char* in, unsigned int len, char* out)
|
||||
|
||||
bool Job::operator==(const Job &other) const
|
||||
{
|
||||
return memcmp(m_id, other.m_id, sizeof(m_id)) == 0;
|
||||
return m_id == other.m_id && memcmp(m_blob, other.m_blob, sizeof(m_blob) == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user