mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 00:15:04 -05:00
Added support for threads restart if config changed.
This commit is contained in:
@@ -99,6 +99,8 @@ public:
|
||||
xmrig::Miner::Miner(Controller *controller)
|
||||
: d_ptr(new MinerPrivate(controller))
|
||||
{
|
||||
controller->addListener(this);
|
||||
|
||||
d_ptr->timer = new Timer(this);
|
||||
|
||||
d_ptr->backends.push_back(new CpuBackend(controller));
|
||||
@@ -218,6 +220,20 @@ void xmrig::Miner::stop()
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Miner::onConfigChanged(Config *config, Config *previousConfig)
|
||||
{
|
||||
if (config->pools() != previousConfig->pools() && config->pools().active() > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Job job = this->job();
|
||||
|
||||
for (IBackend *backend : d_ptr->backends) {
|
||||
backend->setJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Miner::onTimer(const Timer *)
|
||||
{
|
||||
double maxHashrate = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user