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

Correct coinbase check #898

Merged
merged 3 commits into from
Aug 13, 2020
Merged

Correct coinbase check #898

merged 3 commits into from
Aug 13, 2020

Conversation

hdevalence
Copy link
Contributor

@hdevalence hdevalence commented Aug 13, 2020

This should probably have tests, I just noticed this while reviewing #763 and it seemed faster to just do the fix rather than write it down.

Edit:

Previously, the check allowed the first transaction to have multiple coinbase inputs.

This matches the check in zcashd/src/primitives/transaction.h:682
(CTransaction::IsCoinBase).
@hdevalence hdevalence force-pushed the correct-coinbase-check branch from eb76995 to a31818a Compare August 13, 2020 20:17
@hdevalence hdevalence mentioned this pull request Aug 13, 2020
1 task
@hdevalence
Copy link
Contributor Author

This was an ad-hoc check; running through the Zcashd source and itemizing all the consensus rules should be done in other issues.

yaahc
yaahc previously approved these changes Aug 13, 2020
Copy link
Contributor

@yaahc yaahc left a comment

Choose a reason for hiding this comment

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

looks good, got some code tweeks I think might be good but use your best judgement.

zebra-chain/src/block.rs Outdated Show resolved Hide resolved
zebra-chain/src/transaction.rs Outdated Show resolved Hide resolved
This matches zcashd/src/main.cpp:3968-3974 in CheckBlock.

Previously, the check allowed the first transaction to have multiple coinbase inputs.
They're slices internally so we might as well just expose them that way.
@yaahc yaahc merged commit 0791742 into main Aug 13, 2020
@yaahc yaahc deleted the correct-coinbase-check branch August 13, 2020 21:04
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.

2 participants