mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 18:54:43 +00:00
Implemented donate over SOCKS5.
This commit is contained in:
parent
1e2d011705
commit
2fea4e72b5
13 changed files with 47 additions and 15 deletions
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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 @@ class Algorithm;
|
|||
class Job;
|
||||
class JobResult;
|
||||
class Pool;
|
||||
class ProxyUrl;
|
||||
class String;
|
||||
|
||||
|
||||
|
@ -79,6 +80,7 @@ public:
|
|||
virtual void setAlgo(const Algorithm &algo) = 0;
|
||||
virtual void setEnabled(bool enabled) = 0;
|
||||
virtual void setPool(const Pool &pool) = 0;
|
||||
virtual void setProxy(const ProxyUrl &proxy) = 0;
|
||||
virtual void setQuiet(bool quiet) = 0;
|
||||
virtual void setRetries(int retries) = 0;
|
||||
virtual void setRetryPause(uint64_t ms) = 0;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -35,6 +35,7 @@ namespace xmrig {
|
|||
class Algorithm;
|
||||
class IClient;
|
||||
class JobResult;
|
||||
class ProxyUrl;
|
||||
|
||||
|
||||
class IStrategy
|
||||
|
@ -48,6 +49,7 @@ public:
|
|||
virtual void connect() = 0;
|
||||
virtual void resume() = 0;
|
||||
virtual void setAlgo(const Algorithm &algo) = 0;
|
||||
virtual void setProxy(const ProxyUrl &proxy) = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual void tick(uint64_t now) = 0;
|
||||
};
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -56,6 +56,7 @@ protected:
|
|||
inline int64_t sequence() const override { return m_sequence; }
|
||||
inline void setAlgo(const Algorithm &algo) override { m_pool.setAlgo(algo); }
|
||||
inline void setEnabled(bool enabled) override { m_enabled = enabled; }
|
||||
inline void setProxy(const ProxyUrl &proxy) override { m_pool.setProxy(proxy); }
|
||||
inline void setQuiet(bool quiet) override { m_quiet = quiet; }
|
||||
inline void setRetries(int retries) override { m_retries = retries; }
|
||||
inline void setRetryPause(uint64_t ms) override { m_retryPause = ms; }
|
||||
|
|
|
@ -106,6 +106,7 @@ public:
|
|||
inline uint64_t pollInterval() const { return m_pollInterval; }
|
||||
inline void setAlgo(const Algorithm &algorithm) { m_algorithm = algorithm; }
|
||||
inline void setPassword(const String &password) { m_password = password; }
|
||||
inline void setProxy(const ProxyUrl &proxy) { m_proxy = proxy; }
|
||||
inline void setRigId(const String &rigId) { m_rigId = rigId; }
|
||||
inline void setUser(const String &user) { m_user = user; }
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2019 jtgrassie <https://github.com/jtgrassie>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2019 jtgrassie <https://github.com/jtgrassie>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -68,6 +68,7 @@ protected:
|
|||
inline void setAlgo(const Algorithm &algo) override { m_client->setAlgo(algo); }
|
||||
inline void setEnabled(bool enabled) override { m_client->setEnabled(enabled); }
|
||||
inline void setPool(const Pool &pool) override { m_client->setPool(pool); }
|
||||
inline void setProxy(const ProxyUrl &proxy) override { m_client->setProxy(proxy); }
|
||||
inline void setQuiet(bool quiet) override { m_client->setQuiet(quiet); m_quiet = quiet; }
|
||||
inline void setRetries(int retries) override { m_client->setRetries(retries); m_retries = retries; }
|
||||
inline void setRetryPause(uint64_t ms) override { m_client->setRetryPause(ms); m_retryPause = ms; }
|
||||
|
|
|
@ -108,6 +108,14 @@ void xmrig::FailoverStrategy::setAlgo(const Algorithm &algo)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::FailoverStrategy::setProxy(const ProxyUrl &proxy)
|
||||
{
|
||||
for (IClient *client : m_pools) {
|
||||
client->setProxy(proxy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::FailoverStrategy::stop()
|
||||
{
|
||||
for (auto &pool : m_pools) {
|
||||
|
|
|
@ -61,6 +61,7 @@ protected:
|
|||
void connect() override;
|
||||
void resume() override;
|
||||
void setAlgo(const Algorithm &algo) override;
|
||||
void setProxy(const ProxyUrl &proxy) override;
|
||||
void stop() override;
|
||||
void tick(uint64_t now) override;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -75,6 +75,12 @@ void xmrig::SinglePoolStrategy::setAlgo(const Algorithm &algo)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::SinglePoolStrategy::setProxy(const ProxyUrl &proxy)
|
||||
{
|
||||
m_client->setProxy(proxy);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::SinglePoolStrategy::stop()
|
||||
{
|
||||
m_client->disconnect();
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -55,6 +55,7 @@ protected:
|
|||
void connect() override;
|
||||
void resume() override;
|
||||
void setAlgo(const Algorithm &algo) override;
|
||||
void setProxy(const ProxyUrl &proxy) override;
|
||||
void stop() override;
|
||||
void tick(uint64_t now) override;
|
||||
|
||||
|
|
|
@ -256,6 +256,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);
|
||||
|
|
|
@ -125,6 +125,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();
|
||||
|
@ -246,8 +252,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…
Reference in a new issue