-
Notifications
You must be signed in to change notification settings - Fork 38
[GH-#85] Validation for difficulty target #135
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
Conversation
catch | ||
{:error, _message} -> | ||
Logger.error(fn -> | ||
"Failed to mine block" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you log the message here as well?
Not done yet, don't merge |
- do correct check in miner, differing from next calculation
The issue is fixed, you can review it @meivantodorov, @cytadela8, @andonov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
else | ||
[_ | something] = Chain.get_blocks(latest_block_hash, Difficulty.get_number_of_blocks() + 1) | ||
something | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust this logic is correct. it looks weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nedelcho-delchev-tues maybe we can optimize this somehow to be better readable and add some comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a change directly to master, you can see if it is better and more understandable.
@cytadela8
closes #85