Skip to content

Remove clean_jobs check in create_jobs_task - #1595

Closed
DankMiner wants to merge 3 commits into
bitaxeorg:masterfrom
DankMiner:master
Closed

Remove clean_jobs check in create_jobs_task#1595
DankMiner wants to merge 3 commits into
bitaxeorg:masterfrom
DankMiner:master

Conversation

@DankMiner

Copy link
Copy Markdown

Remove unnecessary check for clean_jobs in job creation task.

When a mining.notify with cleanJob=false was received (e.g. after a mining.set_difficulty or new mempool transactions), create_jobs_task skipped calling generate_work() due to an early continue. This meant the ASIC never received the new job and kept mining the previous nonce space. Once the ASIC exhausted and wrapped its nonce range, it resubmitted previously found solutions, causing persistent duplicate share rejections until the next cleanJob=true notify arrived.

The cleanJob flag is already handled correctly in stratum_task.c, which flushes the stratum queue when cleanJob=true. The flag should only control whether queued jobs are discarded — not whether the ASIC receives new work.

Removed the cleanJob=false guard in create_jobs_task.c so that every mining.notify results in generate_work() being called.

Fixes #1587

Remove unnecessary check for clean_jobs in job creation task.

When a `mining.notify` with `cleanJob=false` was received (e.g. after a `mining.set_difficulty` or new mempool transactions), `create_jobs_task` skipped calling `generate_work()` due to an early `continue`. This meant the ASIC never received the new job and kept mining the previous nonce space. Once the ASIC exhausted and wrapped its nonce range, it resubmitted previously found solutions, causing persistent duplicate share rejections until the next `cleanJob=true` notify arrived.

The `cleanJob` flag is already handled correctly in `stratum_task.c`, which flushes the stratum queue when `cleanJob=true`. The flag should only control whether queued jobs are discarded — not whether the ASIC receives new work.

Removed the `cleanJob=false` guard in `create_jobs_task.c` so that every `mining.notify` results in `generate_work()` being called.

Fixes bitaxeorg#1587
@mutatrum

mutatrum commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

The idea of the continue is that it wraps around to the queue_dequeue_timeout with the remainding time of the ASIC job frequency. Otherwise each new mining.notify with cleanJob=false will interrupt the ASIC.

Can you please test with #1731 as I think that was more likely the cause of the duplicates.

@mutatrum

mutatrum commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #1731. Please re-open if the duplicates still occur.

@mutatrum mutatrum closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

esp-miner is unable to handle difficulty change following with "mining.notify" when cleanJob set to false

3 participants