Skip to content
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

Refactor some pow functions #3198

Merged
merged 2 commits into from
Nov 13, 2019
Merged

Refactor some pow functions #3198

merged 2 commits into from
Nov 13, 2019

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Nov 12, 2019

This moves special diff adjustment rule out DGW (cause it has nothing to do with the algo itself) and refactors GetNextWorkRequired (adding missing asserts, reordering things in a more natural way). Should have no changes in actual behaviour.

@UdjinM6 UdjinM6 added this to the 14.1 milestone Nov 12, 2019
Copy link

@nmarley nmarley left a comment

Choose a reason for hiding this comment

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

Agree w/moving special diff rule outside DGW. Those asserts feel dirty to me for some reason, like a "poor-man's error checking". But this is a nit, shouldn't hold up anything.

utACK

@UdjinM6
Copy link
Author

UdjinM6 commented Nov 12, 2019

Those asserts feel dirty to me for some reason, like a "poor-man's error checking".

The first one was introduced in bitcoin@972714c which we backported as part of btc0.15 but it changed GetNextWorkRequiredBTC only. I'm just applying the same logic ("Assert all the things!") to Dash specific code and making one more step here (i.e. checking pblock too).

Copy link

@codablock codablock left a comment

Choose a reason for hiding this comment

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

utACK

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.

3 participants