Skip to content

Commit

Permalink
Always reset nonce on RandomX dataset change
Browse files Browse the repository at this point in the history
Also never get a new job when mining is paused
  • Loading branch information
SChernykh authored and MoneroOcean committed Aug 14, 2024
1 parent 3499939 commit 13211f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/cpu/CpuWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ void xmrig::CpuWorker<N>::start()
}
}

consumeJob();
if (!Nonce::isPaused()) {
consumeJob();
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/core/Miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ void xmrig::Miner::setJob(const Job &job, bool donate)

# ifdef XMRIG_ALGO_RANDOMX
const bool ready = d_ptr->initRX();

// Always reset nonce on RandomX dataset change
if (!ready) {
d_ptr->reset = true;
}
# else
constexpr const bool ready = true;
# endif
Expand Down

0 comments on commit 13211f4

Please sign in to comment.