mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-22 13:12:42 -05:00
Fixed miner freeze when switch between RandomX variants.
This commit is contained in:
@@ -170,6 +170,15 @@ const xmrig::String &xmrig::CpuBackend::type() const
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CpuBackend::prepare(const Job &nextJob)
|
||||
{
|
||||
if (nextJob.algorithm().family() == Algorithm::RANDOM_X && nextJob.algorithm() != d_ptr->algo) {
|
||||
d_ptr->workers.stop();
|
||||
d_ptr->threads.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CpuBackend::printHashrate(bool details)
|
||||
{
|
||||
if (!details || !hashrate()) {
|
||||
|
||||
@@ -49,6 +49,7 @@ protected:
|
||||
const Hashrate *hashrate() const override;
|
||||
const String &profileName() const override;
|
||||
const String &type() const override;
|
||||
void prepare(const Job &nextJob) override;
|
||||
void printHashrate(bool details) override;
|
||||
void setJob(const Job &job) override;
|
||||
void start(IWorker *worker) override;
|
||||
|
||||
Reference in New Issue
Block a user