diff --git a/src/interfaces/IStrategy.h b/src/interfaces/IStrategy.h index 660529ea..6e915401 100644 --- a/src/interfaces/IStrategy.h +++ b/src/interfaces/IStrategy.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,6 +39,7 @@ public: virtual bool isActive() const = 0; virtual int64_t submit(const JobResult &result) = 0; virtual void connect() = 0; + virtual void release() = 0; virtual void resume() = 0; virtual void stop() = 0; virtual void tick(uint64_t now) = 0; diff --git a/src/interfaces/IStrategyListener.h b/src/interfaces/IStrategyListener.h index 60f95734..9f2c4487 100644 --- a/src/interfaces/IStrategyListener.h +++ b/src/interfaces/IStrategyListener.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,10 +39,10 @@ class IStrategyListener public: virtual ~IStrategyListener() {} - virtual void onActive(Client *client) = 0; - virtual void onJob(Client *client, const Job &job) = 0; - virtual void onPause(IStrategy *strategy) = 0; - virtual void onResultAccepted(Client *client, const SubmitResult &result, const char *error) = 0; + virtual void onActive(IStrategy *strategy, Client *client) = 0; + virtual void onJob(IStrategy *strategy, Client *client, const Job &job) = 0; + virtual void onPause(IStrategy *strategy) = 0; + virtual void onResultAccepted(IStrategy *strategy, Client *client, const SubmitResult &result, const char *error) = 0; }; diff --git a/src/net/Job.h b/src/net/Job.h index 4f9c472e..b8b9d6bc 100644 --- a/src/net/Job.h +++ b/src/net/Job.h @@ -61,6 +61,7 @@ public: 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 setPoolId(int poolId) { m_poolId = poolId; } inline void setThreadId(int threadId) { m_threadId = threadId; } static bool fromHex(const char* in, unsigned int len, unsigned char* out); diff --git a/src/net/Network.cpp b/src/net/Network.cpp index e0f65497..ede3f8b4 100644 --- a/src/net/Network.cpp +++ b/src/net/Network.cpp @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,6 @@ #include "net/SubmitResult.h" #include "net/Url.h" #include "Options.h" -#include "Platform.h" #include "workers/Workers.h" @@ -55,14 +54,14 @@ Network::Network(const Options *options) : const std::vector &pools = options->pools(); if (pools.size() > 1) { - m_strategy = new FailoverStrategy(pools, Platform::userAgent(), this); + m_strategy = new FailoverStrategy(pools, options->retryPause(), options->retries(), this); } else { - m_strategy = new SinglePoolStrategy(pools.front(), Platform::userAgent(), this); + m_strategy = new SinglePoolStrategy(pools.front(), options->retryPause(), this); } if (m_options->donateLevel() > 0) { - m_donate = new DonateStrategy(Platform::userAgent(), this); + m_donate = new DonateStrategy(options->donateLevel(), options->pools().front()->user(), options->algo(), this); } m_timer.data = this; @@ -93,9 +92,9 @@ void Network::stop() } -void Network::onActive(Client *client) +void Network::onActive(IStrategy *strategy, Client *client) { - if (client->id() == -1) { + if (m_donate && m_donate == strategy) { LOG_NOTICE("dev donate started"); return; } @@ -106,13 +105,13 @@ void Network::onActive(Client *client) } -void Network::onJob(Client *client, const Job &job) +void Network::onJob(IStrategy *strategy, Client *client, const Job &job) { - if (m_donate && m_donate->isActive() && client->id() != -1) { + if (m_donate && m_donate->isActive() && m_donate != strategy) { return; } - setJob(client, job); + setJob(client, job, m_donate == strategy); } @@ -142,7 +141,7 @@ void Network::onPause(IStrategy *strategy) } -void Network::onResultAccepted(Client *client, const SubmitResult &result, const char *error) +void Network::onResultAccepted(IStrategy *strategy, Client *client, const SubmitResult &result, const char *error) { m_state.add(result, error); @@ -159,7 +158,7 @@ void Network::onResultAccepted(Client *client, const SubmitResult &result, const } -void Network::setJob(Client *client, const Job &job) +void Network::setJob(Client *client, const Job &job, bool donate) { if (m_options->colors()) { LOG_INFO("\x1B[01;35mnew job\x1B[0m from \x1B[01;37m%s:%d\x1B[0m diff \x1B[01;37m%d", client->host(), client->port(), job.diff()); @@ -169,7 +168,7 @@ void Network::setJob(Client *client, const Job &job) } m_state.diff = job.diff(); - Workers::setJob(job); + Workers::setJob(job, donate); } diff --git a/src/net/Network.h b/src/net/Network.h index fe13d9b7..fae5c563 100644 --- a/src/net/Network.h +++ b/src/net/Network.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,16 +49,16 @@ public: void stop(); protected: - void onActive(Client *client) override; - void onJob(Client *client, const Job &job) override; + void onActive(IStrategy *strategy, Client *client) override; + void onJob(IStrategy *strategy, Client *client, const Job &job) override; void onJobResult(const JobResult &result) override; void onPause(IStrategy *strategy) override; - void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; + void onResultAccepted(IStrategy *strategy, Client *client, const SubmitResult &result, const char *error) override; private: constexpr static int kTickInterval = 1 * 1000; - void setJob(Client *client, const Job &job); + void setJob(Client *client, const Job &job, bool donate); void tick(); static void onTick(uv_timer_t *handle); diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index 84d1e4da..8100afc0 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -26,7 +26,8 @@ #include "net/Client.h" #include "net/Job.h" #include "net/strategies/DonateStrategy.h" -#include "Options.h" +#include "net/strategies/FailoverStrategy.h" +#include "Platform.h" #include "xmrig.h" @@ -36,27 +37,36 @@ extern "C" } -DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) : +const static char *kDonatePool = "thanks.xmrig.com"; +const static char *kDonatePoolIP = "45.76.34.221"; + + +DonateStrategy::DonateStrategy(int level, const char *user, int algo, IStrategyListener *listener) : m_active(false), - m_donateTime(Options::i()->donateLevel() * 60 * 1000), - m_idleTime((100 - Options::i()->donateLevel()) * 60 * 1000), + m_donateTime(level * 60 * 1000), + m_idleTime((100 - level) * 60 * 1000), + m_strategy(nullptr), m_listener(listener) { uint8_t hash[200]; char userId[65] = { 0 }; - const char *user = Options::i()->pools().front()->user(); keccak(reinterpret_cast(user), static_cast(strlen(user)), hash, sizeof(hash)); Job::toHex(hash, 32, userId); - Url *url = new Url("thanks.xmrig.com", Options::i()->algo() == xmrig::ALGO_CRYPTONIGHT_LITE ? 5555 : 80, userId, nullptr, false, true); + if (algo == xmrig::ALGO_CRYPTONIGHT) { + m_pools.push_back(new Url(kDonatePool, 80, userId, nullptr, false, true)); + m_pools.push_back(new Url(kDonatePool, 443, userId, nullptr, false, true)); + m_pools.push_back(new Url(kDonatePoolIP, 80, userId, nullptr, false, true)); + m_pools.push_back(new Url(kDonatePoolIP, 443, userId, nullptr, false, true)); + m_pools.push_back(new Url("emergency.xmrig.com", 5555, "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD", "emergency", false, false)); + } + else { + m_pools.push_back(new Url(kDonatePool, 5555, userId, nullptr, false, true)); + m_pools.push_back(new Url(kDonatePoolIP, 5555, userId, nullptr, false, true)); + } - m_client = new Client(-1, agent, this); - m_client->setUrl(url); - m_client->setRetryPause(Options::i()->retryPause() * 1000); - m_client->setQuiet(true); - - delete url; + m_strategy = new FailoverStrategy(m_pools, 1, 1, this, true); m_timer.data = this; uv_timer_init(uv_default_loop(), &m_timer); @@ -65,56 +75,66 @@ DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) : } +DonateStrategy::~DonateStrategy() +{ +} + + int64_t DonateStrategy::submit(const JobResult &result) { - return m_client->submit(result); + return m_strategy->submit(result); } void DonateStrategy::connect() { - m_client->connect(); + m_strategy->connect(); +} + + +void DonateStrategy::release() +{ } void DonateStrategy::stop() { uv_timer_stop(&m_timer); - m_client->disconnect(); + m_strategy->stop(); } void DonateStrategy::tick(uint64_t now) { - m_client->tick(now); + m_strategy->tick(now); } -void DonateStrategy::onClose(Client *client, int failures) -{ -} - - -void DonateStrategy::onJobReceived(Client *client, const Job &job) -{ - m_listener->onJob(client, job); -} - - -void DonateStrategy::onLoginSuccess(Client *client) +void DonateStrategy::onActive(IStrategy *strategy, Client *client) { if (!isActive()) { uv_timer_start(&m_timer, DonateStrategy::onTimer, m_donateTime, 0); } m_active = true; - m_listener->onActive(client); + m_listener->onActive(this, client); } -void DonateStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) +void DonateStrategy::onJob(IStrategy *strategy, Client *client, const Job &job) { - m_listener->onResultAccepted(client, result, error); + m_listener->onJob(this, client, job); +} + + +void DonateStrategy::onPause(IStrategy *strategy) +{ +} + + +void DonateStrategy::onResultAccepted(IStrategy *strategy, Client *client, const SubmitResult &result, const char *error) +{ + m_listener->onResultAccepted(this, client, result, error); } @@ -126,7 +146,7 @@ void DonateStrategy::idle() void DonateStrategy::suspend() { - m_client->disconnect(); + m_strategy->stop(); m_active = false; m_listener->onPause(this); diff --git a/src/net/strategies/DonateStrategy.h b/src/net/strategies/DonateStrategy.h index 07011053..bb3b63b7 100644 --- a/src/net/strategies/DonateStrategy.h +++ b/src/net/strategies/DonateStrategy.h @@ -26,10 +26,12 @@ #include +#include #include "interfaces/IClientListener.h" #include "interfaces/IStrategy.h" +#include "interfaces/IStrategyListener.h" class Client; @@ -37,10 +39,11 @@ class IStrategyListener; class Url; -class DonateStrategy : public IStrategy, public IClientListener +class DonateStrategy : public IStrategy, public IStrategyListener { public: - DonateStrategy(const char *agent, IStrategyListener *listener); + DonateStrategy(int level, const char *user, int algo, IStrategyListener *listener); + ~DonateStrategy(); public: inline bool isActive() const override { return m_active; } @@ -48,14 +51,15 @@ public: int64_t submit(const JobResult &result) override; void connect() override; + void release() override; void stop() override; void tick(uint64_t now) override; protected: - void onClose(Client *client, int failures) override; - void onJobReceived(Client *client, const Job &job) override; - void onLoginSuccess(Client *client) override; - void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; + void onActive(IStrategy *strategy, Client *client) override; + void onJob(IStrategy *strategy, Client *client, const Job &job) override; + void onPause(IStrategy *strategy) override; + void onResultAccepted(IStrategy *strategy, Client *client, const SubmitResult &result, const char *error) override; private: void idle(); @@ -64,10 +68,11 @@ private: static void onTimer(uv_timer_t *handle); bool m_active; - Client *m_client; const int m_donateTime; const int m_idleTime; + IStrategy *m_strategy; IStrategyListener *m_listener; + std::vector m_pools; uv_timer_t m_timer; }; diff --git a/src/net/strategies/FailoverStrategy.cpp b/src/net/strategies/FailoverStrategy.cpp index 47d390b0..52bd2fbf 100644 --- a/src/net/strategies/FailoverStrategy.cpp +++ b/src/net/strategies/FailoverStrategy.cpp @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,16 +25,29 @@ #include "interfaces/IStrategyListener.h" #include "net/Client.h" #include "net/strategies/FailoverStrategy.h" -#include "Options.h" +#include "Platform.h" -FailoverStrategy::FailoverStrategy(const std::vector &urls, const char *agent, IStrategyListener *listener) : +FailoverStrategy::FailoverStrategy(const std::vector &urls, int retryPause, int retries, IStrategyListener *listener, bool quiet) : + m_release(false), + m_quiet(quiet), + m_retries(retries), + m_retryPause(retryPause), m_active(-1), m_index(0), + m_remaining(0), m_listener(listener) { for (const Url *url : urls) { - add(url, agent); + add(url); + } +} + + +FailoverStrategy::~FailoverStrategy() +{ + for (Client *client : m_pools) { + delete client; } } @@ -51,13 +64,25 @@ void FailoverStrategy::connect() } +void FailoverStrategy::release() +{ + m_release = true; + + for (size_t i = 0; i < m_pools.size(); ++i) { + if (m_pools[i]->disconnect()) { + m_remaining++; + } + } +} + + void FailoverStrategy::resume() { if (!isActive()) { return; } - m_listener->onJob( m_pools[m_active], m_pools[m_active]->job()); + m_listener->onJob(this, m_pools[m_active], m_pools[m_active]->job()); } @@ -85,6 +110,14 @@ void FailoverStrategy::tick(uint64_t now) void FailoverStrategy::onClose(Client *client, int failures) { if (failures == -1) { + if (m_release) { + m_remaining--; + + if (m_remaining == 0) { + delete this; + } + } + return; } @@ -93,7 +126,7 @@ void FailoverStrategy::onClose(Client *client, int failures) m_listener->onPause(this); } - if (m_index == 0 && failures < Options::i()->retries()) { + if (m_index == 0 && failures < m_retries) { return; } @@ -106,7 +139,7 @@ void FailoverStrategy::onClose(Client *client, int failures) void FailoverStrategy::onJobReceived(Client *client, const Job &job) { if (m_active == client->id()) { - m_listener->onJob(client, job); + m_listener->onJob(this, client, job); } } @@ -127,22 +160,23 @@ void FailoverStrategy::onLoginSuccess(Client *client) if (active >= 0 && active != m_active) { m_index = m_active = active; - m_listener->onActive(client); + m_listener->onActive(this, client); } } void FailoverStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - m_listener->onResultAccepted(client, result, error); + m_listener->onResultAccepted(this, client, result, error); } -void FailoverStrategy::add(const Url *url, const char *agent) +void FailoverStrategy::add(const Url *url) { - Client *client = new Client((int) m_pools.size(), agent, this); + Client *client = new Client((int) m_pools.size(), Platform::userAgent(), this); client->setUrl(url); - client->setRetryPause(Options::i()->retryPause() * 1000); + client->setRetryPause(m_retryPause * 1000); + client->setQuiet(m_quiet); m_pools.push_back(client); } diff --git a/src/net/strategies/FailoverStrategy.h b/src/net/strategies/FailoverStrategy.h index 963d3157..c8e24fb1 100644 --- a/src/net/strategies/FailoverStrategy.h +++ b/src/net/strategies/FailoverStrategy.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,13 +40,15 @@ class Url; class FailoverStrategy : public IStrategy, public IClientListener { public: - FailoverStrategy(const std::vector &urls, const char *agent, IStrategyListener *listener); + FailoverStrategy(const std::vector &urls, int retryPause, int retries, IStrategyListener *listener, bool quiet = false); + ~FailoverStrategy(); public: inline bool isActive() const override { return m_active >= 0; } int64_t submit(const JobResult &result) override; void connect() override; + void release() override; void resume() override; void stop() override; void tick(uint64_t now) override; @@ -58,10 +60,15 @@ protected: void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; private: - void add(const Url *url, const char *agent); + void add(const Url *url); + bool m_release; + const bool m_quiet; + const int m_retries; + const int m_retryPause; int m_active; int m_index; + int m_remaining; IStrategyListener *m_listener; std::vector m_pools; }; diff --git a/src/net/strategies/SinglePoolStrategy.cpp b/src/net/strategies/SinglePoolStrategy.cpp index 997dc00b..b0d98519 100644 --- a/src/net/strategies/SinglePoolStrategy.cpp +++ b/src/net/strategies/SinglePoolStrategy.cpp @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,16 +25,24 @@ #include "interfaces/IStrategyListener.h" #include "net/Client.h" #include "net/strategies/SinglePoolStrategy.h" -#include "Options.h" +#include "Platform.h" -SinglePoolStrategy::SinglePoolStrategy(const Url *url, const char *agent, IStrategyListener *listener) : +SinglePoolStrategy::SinglePoolStrategy(const Url *url, int retryPause, IStrategyListener *listener, bool quiet) : m_active(false), + m_release(false), m_listener(listener) { - m_client = new Client(0, agent, this); + m_client = new Client(0, Platform::userAgent(), this); m_client->setUrl(url); - m_client->setRetryPause(Options::i()->retryPause() * 1000); + m_client->setRetryPause(retryPause * 1000); + m_client->setQuiet(quiet); +} + + +SinglePoolStrategy::~SinglePoolStrategy() +{ + delete m_client; } @@ -50,13 +58,20 @@ void SinglePoolStrategy::connect() } +void SinglePoolStrategy::release() +{ + m_release = true; + m_client->disconnect(); +} + + void SinglePoolStrategy::resume() { if (!isActive()) { return; } - m_listener->onJob(m_client, m_client->job()); + m_listener->onJob(this, m_client, m_client->job()); } @@ -74,6 +89,11 @@ void SinglePoolStrategy::tick(uint64_t now) void SinglePoolStrategy::onClose(Client *client, int failures) { + if (m_release) { + delete this; + return; + } + if (!isActive()) { return; } @@ -85,18 +105,18 @@ void SinglePoolStrategy::onClose(Client *client, int failures) void SinglePoolStrategy::onJobReceived(Client *client, const Job &job) { - m_listener->onJob(client, job); + m_listener->onJob(this, client, job); } void SinglePoolStrategy::onLoginSuccess(Client *client) { m_active = true; - m_listener->onActive(client); + m_listener->onActive(this, client); } void SinglePoolStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - m_listener->onResultAccepted(client, result, error); + m_listener->onResultAccepted(this, client, result, error); } diff --git a/src/net/strategies/SinglePoolStrategy.h b/src/net/strategies/SinglePoolStrategy.h index 95e21547..18d2192b 100644 --- a/src/net/strategies/SinglePoolStrategy.h +++ b/src/net/strategies/SinglePoolStrategy.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,13 +37,15 @@ class Url; class SinglePoolStrategy : public IStrategy, public IClientListener { public: - SinglePoolStrategy(const Url *url, const char *agent, IStrategyListener *listener); + SinglePoolStrategy(const Url *url, int retryPause, IStrategyListener *listener, bool quiet = false); + ~SinglePoolStrategy(); public: inline bool isActive() const override { return m_active; } int64_t submit(const JobResult &result) override; void connect() override; + void release() override; void resume() override; void stop() override; void tick(uint64_t now) override; @@ -56,6 +58,7 @@ protected: private: bool m_active; + bool m_release; Client *m_client; IStrategyListener *m_listener; }; diff --git a/src/workers/Worker.cpp b/src/workers/Worker.cpp index 02646ced..7a7ff986 100644 --- a/src/workers/Worker.cpp +++ b/src/workers/Worker.cpp @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/workers/Worker.h b/src/workers/Worker.h index 11c4a198..08a0551f 100644 --- a/src/workers/Worker.h +++ b/src/workers/Worker.h @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 039a1793..f0aef448 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -83,10 +83,14 @@ void Workers::setEnabled(bool enabled) } -void Workers::setJob(const Job &job) +void Workers::setJob(const Job &job, bool donate) { uv_rwlock_wrlock(&m_rwlock); m_job = job; + + if (donate) { + m_job.setPoolId(-1); + } uv_rwlock_wrunlock(&m_rwlock); m_active = true; diff --git a/src/workers/Workers.h b/src/workers/Workers.h index e76d0a62..1c85089a 100644 --- a/src/workers/Workers.h +++ b/src/workers/Workers.h @@ -45,7 +45,7 @@ public: static Job job(); static void printHashrate(bool detail); static void setEnabled(bool enabled); - static void setJob(const Job &job); + static void setJob(const Job &job, bool donate); static void start(int64_t affinity, int priority); static void stop(); static void submit(const JobResult &result);