Buffer --rand-nonce option without having to continuously execute a function
This commit is contained in:
parent
6516517235
commit
2ee4b2c91d
1 changed files with 3 additions and 1 deletions
|
@ -38,6 +38,7 @@ SingleWorker::SingleWorker(Handle *handle)
|
||||||
|
|
||||||
void SingleWorker::start()
|
void SingleWorker::start()
|
||||||
{
|
{
|
||||||
|
bool israndnonce = false;
|
||||||
while (Workers::sequence() > 0) {
|
while (Workers::sequence() > 0) {
|
||||||
if (Workers::isPaused()) {
|
if (Workers::isPaused()) {
|
||||||
do {
|
do {
|
||||||
|
@ -48,13 +49,14 @@ void SingleWorker::start()
|
||||||
consumeJob();
|
consumeJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
israndnonce = m_job.isRandNonce();
|
||||||
while (!Workers::isOutdated(m_sequence)) {
|
while (!Workers::isOutdated(m_sequence)) {
|
||||||
if ((m_count & 0xF) == 0) {
|
if ((m_count & 0xF) == 0) {
|
||||||
storeStats();
|
storeStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_count++;
|
m_count++;
|
||||||
if (m_job.isRandNonce()) {
|
if (israndnonce) {
|
||||||
*m_job.nonce() = m_result.nonce += rand();
|
*m_job.nonce() = m_result.nonce += rand();
|
||||||
} else {
|
} else {
|
||||||
*m_job.nonce() = ++m_result.nonce;
|
*m_job.nonce() = ++m_result.nonce;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue