Skip to content

[GH-#85] Validation for difficulty target#135

Merged
andonov merged 4 commits into
masterfrom
GH-85
Nov 22, 2017
Merged

[GH-#85] Validation for difficulty target#135
andonov merged 4 commits into
masterfrom
GH-85

Conversation

@nedelcho-delchev-tues

Copy link
Copy Markdown

closes #85

Comment thread apps/aecore/lib/aecore/miner/worker.ex Outdated
catch
{:error, _message} ->
Logger.error(fn ->
"Failed to mine block"

@thepiwo thepiwo Nov 21, 2017

Copy link
Copy Markdown
Contributor

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?

@nedelcho-delchev-tues

Copy link
Copy Markdown
Author

Not done yet, don't merge

 - do correct check in miner, differing from next calculation
@nedelcho-delchev-tues

Copy link
Copy Markdown
Author

The issue is fixed, you can review it @meivantodorov, @cytadela8, @andonov.

@cytadela8 cytadela8 left a comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Author

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

@andonov andonov merged commit fe23bb5 into master Nov 22, 2017
@thepiwo thepiwo deleted the GH-85 branch October 5, 2018 11:48
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.

validate difficulty target

5 participants