-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streamline create_jobs_task #478
base: master
Are you sure you want to change the base?
Conversation
Looking at it now. There's a difference in where extranonce_2 is reset back to 0, in the old code it was inside the I logged the extranonce_2, and with the old code there's a weird pattern which I don't think is what was supposed to happen:
With the new code, it actually resets after a mining notify:
Is resetting the extranonce_2 a better approach for covering the space, or is that dictated by other fields anyways? Maybe even simpler to have it just continuously increase, and never reset. Other than this, it looks good. Not sure why there was such a big chunk of code duplicated. Nice cleanup. |
Good callout. I'll just move it back to static for now. |
31c04d3
to
26d7f19
Compare
LGTM, can just use a little more cleanup. |
26d7f19
to
5a28346
Compare
I simplified the code by merging
process_mining_job
andgenerate_additional_work
into a single function, as their separation was unnecessary - they performed the same task except for howextranonce_2
was incremented ingenerate_additional_work
. I moved theextranonce_2
logic into the while loop for better clarity and flow, and removed the unnecessary yielding mechanismIn addition this also changes how
extranonce_2
is rolled between notifies.New version
Old version