mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-31 06:55:57 +00:00
Merge pull request #2837 from SChernykh/dev
RandomX: don't restart mining threads when the seed changes
This commit is contained in:
commit
f5447088cb
3 changed files with 11 additions and 3 deletions
|
@ -134,7 +134,7 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
||||||
RxDataset *dataset = Rx::dataset(m_job.currentJob(), node());
|
RxDataset *dataset = Rx::dataset(m_job.currentJob(), node());
|
||||||
|
|
||||||
while (dataset == nullptr) {
|
while (dataset == nullptr) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||||
|
|
||||||
if (Nonce::sequence(Nonce::CPU) == 0) {
|
if (Nonce::sequence(Nonce::CPU) == 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -246,7 +246,7 @@ void xmrig::CpuWorker<N>::start()
|
||||||
while (Nonce::sequence(Nonce::CPU) > 0) {
|
while (Nonce::sequence(Nonce::CPU) > 0) {
|
||||||
if (Nonce::isPaused()) {
|
if (Nonce::isPaused()) {
|
||||||
do {
|
do {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||||
}
|
}
|
||||||
while (Nonce::isPaused() && Nonce::sequence(Nonce::CPU) > 0);
|
while (Nonce::isPaused() && Nonce::sequence(Nonce::CPU) > 0);
|
||||||
|
|
||||||
|
|
|
@ -553,7 +553,13 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
if (job.algorithm().family() == Algorithm::RANDOM_X && !Rx::isReady(job)) {
|
if (job.algorithm().family() == Algorithm::RANDOM_X && !Rx::isReady(job)) {
|
||||||
stop();
|
if (d_ptr->algorithm != job.algorithm()) {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Nonce::pause(true);
|
||||||
|
Nonce::touch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,8 @@ void xmrig::RxQueue::backgroundInit()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update seed here again in case there was more than one item in the queue
|
||||||
|
m_seed = item.seed;
|
||||||
m_state = STATE_IDLE;
|
m_state = STATE_IDLE;
|
||||||
m_async->send();
|
m_async->send();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue