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 allowed revokes in blk contxt. #1037

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 15, 2018

This moves the test for validating the revocations in the block are actually eligible to be revoked per the results of the ticket lottery into the checkBlockContext function where it more naturally belongs since it is only dependent on the block and its contextual position within the chain.

While here, it also refactors the check into a separate function named checkAllowedRevocations to improve readability. Also, since this was the final check in the CheckBlockStakeSanity function, that entire function has been removed along with its call site.

This moves the test for validating the votes in the block are eligible
votes per the results of the ticket lottery into the checkBlockContext
function where it more naturally belongs since it is only dependent on
the block and its contextual position within the chain.

While here, it also refactors the check into a separate function named
checkAllowedVotes to improve readability.
This moves the test for validating the revocations in the block are
actually eligible to be revoked per the results of the ticket lottery
into the checkBlockContext function where it more naturally belongs
since it is only dependent on the block and its contextual position
within the chain.

While here, it also refactors the check into a separate function named
checkAllowedRevocations to improve readability.  Also, since this was
the final check in the CheckBlockStakeSanity function, that entire
function has been removed along with its call site.
@davecgh davecgh merged commit f4d5baa into decred:master Feb 16, 2018
@davecgh davecgh deleted the blockchain_validate_allowed_revocations_block_context branch February 16, 2018 00:28
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