Fix in Job POW parsing
This commit is contained in:
parent
6574a8e844
commit
0e95eebb2a
3 changed files with 5 additions and 1 deletions
|
@ -52,6 +52,7 @@ int64_t Client::m_sequence = 1;
|
||||||
Client::Client(int id, const char *agent, IClientListener *listener) :
|
Client::Client(int id, const char *agent, IClientListener *listener) :
|
||||||
m_quiet(false),
|
m_quiet(false),
|
||||||
m_nicehash(false),
|
m_nicehash(false),
|
||||||
|
m_donate(false),
|
||||||
m_agent(agent),
|
m_agent(agent),
|
||||||
m_listener(listener),
|
m_listener(listener),
|
||||||
m_id(id),
|
m_id(id),
|
||||||
|
@ -231,7 +232,7 @@ bool Client::parseJob(const rapidjson::Value ¶ms, int *code)
|
||||||
|
|
||||||
PowVariant powVariant = Options::i()->powVariant();
|
PowVariant powVariant = Options::i()->powVariant();
|
||||||
|
|
||||||
if (!Options::i()->forcePowVariant()) {
|
if (!Options::i()->forcePowVariant() || m_donate) {
|
||||||
if (params.HasMember("algo")) {
|
if (params.HasMember("algo")) {
|
||||||
std::string algo = params["algo"].GetString();
|
std::string algo = params["algo"].GetString();
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ public:
|
||||||
inline int id() const { return m_id; }
|
inline int id() const { return m_id; }
|
||||||
inline uint16_t port() const { return m_url.port(); }
|
inline uint16_t port() const { return m_url.port(); }
|
||||||
inline void setQuiet(bool quiet) { m_quiet = quiet; }
|
inline void setQuiet(bool quiet) { m_quiet = quiet; }
|
||||||
|
inline void setDonate(bool donate) { m_donate = donate; }
|
||||||
inline void setRetryPause(int ms) { m_retryPause = ms; }
|
inline void setRetryPause(int ms) { m_retryPause = ms; }
|
||||||
|
|
||||||
static void onConnected(uv_async_t *handle);
|
static void onConnected(uv_async_t *handle);
|
||||||
|
@ -99,6 +100,7 @@ private:
|
||||||
|
|
||||||
bool m_quiet;
|
bool m_quiet;
|
||||||
bool m_nicehash;
|
bool m_nicehash;
|
||||||
|
bool m_donate;
|
||||||
char m_buf[2048];
|
char m_buf[2048];
|
||||||
char m_rpcId[64];
|
char m_rpcId[64];
|
||||||
char m_sendBuf[768];
|
char m_sendBuf[768];
|
||||||
|
|
|
@ -81,6 +81,7 @@ DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) :
|
||||||
m_client->setUrl(url);
|
m_client->setUrl(url);
|
||||||
m_client->setRetryPause(Options::i()->retryPause() * 1000);
|
m_client->setRetryPause(Options::i()->retryPause() * 1000);
|
||||||
m_client->setQuiet(true);
|
m_client->setQuiet(true);
|
||||||
|
m_client->setDonate(true);
|
||||||
|
|
||||||
delete url;
|
delete url;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue