mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-23 14:52:52 -05:00
Implemented dynamic pool reload.
This commit is contained in:
@@ -47,6 +47,7 @@ xmrig::Network::Network(Controller *controller) :
|
||||
m_donate(nullptr)
|
||||
{
|
||||
Workers::setListener(this);
|
||||
controller->addListener(this);
|
||||
|
||||
const Pools &pools = controller->config()->pools();
|
||||
m_strategy = pools.createStrategy(this);
|
||||
@@ -64,6 +65,7 @@ xmrig::Network::Network(Controller *controller) :
|
||||
|
||||
xmrig::Network::~Network()
|
||||
{
|
||||
delete m_strategy;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +106,22 @@ void xmrig::Network::onActive(IStrategy *strategy, Client *client)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Network::onConfigChanged(Config *config, Config *previousConfig)
|
||||
{
|
||||
if (config->pools() == previousConfig->pools() || !config->pools().active()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_strategy->stop();
|
||||
|
||||
config->pools().print();
|
||||
|
||||
delete m_strategy;
|
||||
m_strategy = config->pools().createStrategy(this);
|
||||
connect();
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Network::onJob(IStrategy *strategy, Client *client, const Job &job)
|
||||
{
|
||||
if (m_donate && m_donate->isActive() && m_donate != strategy) {
|
||||
|
||||
Reference in New Issue
Block a user