This commit is contained in:
commit
b6674abb41
59 changed files with 2180 additions and 1534 deletions
|
@ -142,7 +142,7 @@ void xmrig::Network::onConfigChanged(Config *config, Config *previousConfig)
|
|||
config->pools().print();
|
||||
|
||||
delete m_strategy;
|
||||
m_strategy = config->pools().createStrategy(this);
|
||||
m_strategy = config->pools().createStrategy(m_state);
|
||||
connect();
|
||||
}
|
||||
|
||||
|
@ -264,6 +264,7 @@ void xmrig::Network::setJob(IClient *client, const Job &job, bool donate)
|
|||
|
||||
if (!donate && m_donate) {
|
||||
m_donate->setAlgo(job.algorithm());
|
||||
m_donate->setProxy(client->pool().proxy());
|
||||
}
|
||||
|
||||
m_controller->miner()->setJob(job, donate);
|
||||
|
|
|
@ -117,6 +117,12 @@ void xmrig::DonateStrategy::setAlgo(const xmrig::Algorithm &algo)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::DonateStrategy::setProxy(const ProxyUrl &proxy)
|
||||
{
|
||||
m_strategy->setProxy(proxy);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::DonateStrategy::stop()
|
||||
{
|
||||
m_timer->stop();
|
||||
|
@ -238,8 +244,9 @@ xmrig::IClient *xmrig::DonateStrategy::createProxy()
|
|||
const IClient *client = strategy->client();
|
||||
m_tls = client->hasExtension(IClient::EXT_TLS);
|
||||
|
||||
Pool pool(client->ip(), client->pool().port(), m_userId, client->pool().password(), 0, true, client->isTLS());
|
||||
Pool pool(client->pool().proxy().isValid() ? client->pool().host() : client->ip(), client->pool().port(), m_userId, client->pool().password(), 0, true, client->isTLS());
|
||||
pool.setAlgo(client->pool().algorithm());
|
||||
pool.setProxy(client->pool().proxy());
|
||||
|
||||
IClient *proxy = new Client(-1, Platform::userAgent(), this);
|
||||
proxy->setPool(pool);
|
||||
|
|
|
@ -65,6 +65,7 @@ protected:
|
|||
int64_t submit(const JobResult &result) override;
|
||||
void connect() override;
|
||||
void setAlgo(const Algorithm &algo) override;
|
||||
void setProxy(const ProxyUrl &proxy) override;
|
||||
void stop() override;
|
||||
void tick(uint64_t now) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue