Implemented DonateStrategy.

This commit is contained in:
XMRig 2017-06-30 03:20:50 +03:00
parent 25faeabd61
commit 7e17f77c11
8 changed files with 88 additions and 37 deletions

View file

@ -147,9 +147,14 @@ void Network::onJobResult(const JobResult &result)
void Network::onPause(IStrategy *strategy)
{
if ((m_donate && !m_donate->isActive()) || !m_strategy->isActive()) {
if (m_donate && m_donate == strategy) {
LOG_NOTICE("dev donate finished");
m_strategy->resume();
}
if (!m_strategy->isActive()) {
LOG_ERR("no active pools, pause mining");
Workers::pause();
return Workers::pause();
}
}
@ -168,18 +173,6 @@ void Network::setJob(Client *client, const Job &job)
}
void Network::startDonate()
{
if (m_donateActive) {
return;
}
LOG_NOTICE("dev donate started");
m_donateActive = true;
}
void Network::stopDonate()
{
// if (!m_donateActive) {