Skip to content

fix: reset extranonce2 only if clean_jobs == true#1603

Open
blackmennewstyle wants to merge 3 commits intobitaxeorg:masterfrom
blackmennewstyle:master
Open

fix: reset extranonce2 only if clean_jobs == true#1603
blackmennewstyle wants to merge 3 commits intobitaxeorg:masterfrom
blackmennewstyle:master

Conversation

@blackmennewstyle
Copy link

This PR improves the extranonce2 reset.
It is only performed if clean_jobs == true.
The previous code was triggering a cascade of duplicate shares after a varDiff change:

This PR improves the extranonce2 reset.
It is only performed if clean_jobs == true.
The previous code was triggering a cascade of duplicate shares after a varDiff change:
- mining.set_difficulty
- mining.notify with clean_jobs is set to false
The behavior is described here: bitaxeorg#1587 (comment)
@blackmennewstyle blackmennewstyle changed the title Reset extranonce2 only if clean_jobs == true fix: reset extranonce2 only if clean_jobs == true Mar 11, 2026
if (!current_mining_notification->clean_jobs) {
continue;
// reset extranonce2 only if clean_jobs == true
// avoid a cosmic festival of duplicated shares
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// reset extranonce2 only if clean_jobs == true The code already shows this.
I think its better to explain a decision, so the cause of the duplicates that led to this PR
so in the future when you look the code again its obvious.

Copy link
Author

@blackmennewstyle blackmennewstyle Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should i close this PR and make a new one?

I changed it, hopefully it is better.

More explicit explanation for future code reviewers/contributors.
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.

2 participants