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

blockchain: Validate num votes in header sanity. #1005

Merged

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 1, 2018

This moves the test for validating the number of votes specified by the header is at least the required minimum into the checkBlockHeaderSanity function where it more naturally belongs since it is solely dependent on information the header.

Also, remove the redundant check for the same condition from checkBlockSanity since it has now already been checked according to the value the header commits to and therefore validating the header commitment for the number of votes implies correctness.

@davecgh davecgh force-pushed the blockchain_validate_numvotes_header_sanity branch 3 times, most recently from b6a3511 to 918e7c0 Compare February 2, 2018 01:15
This moves the test for validating the number of votes specified by the
header is at least the required minimum into the checkBlockHeaderSanity
function where it more naturally belongs since it is solely dependent on
information the header.

Also, remove the redundant check for the same condition from
checkBlockSanity since it has now already been checked according to the
value the header commits to and therefore validating the header
commitment for the number of votes implies correctness.
@davecgh davecgh force-pushed the blockchain_validate_numvotes_header_sanity branch from 918e7c0 to 1273cd0 Compare February 2, 2018 01:17
@davecgh davecgh merged commit 1273cd0 into decred:master Feb 2, 2018
@davecgh davecgh deleted the blockchain_validate_numvotes_header_sanity branch February 2, 2018 01:52
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