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

Blockheader::spv_validate() is misleadingly named #182

Closed
petertodd opened this issue Oct 27, 2018 · 1 comment · Fixed by #273
Closed

Blockheader::spv_validate() is misleadingly named #182

petertodd opened this issue Oct 27, 2018 · 1 comment · Fixed by #273

Comments

@petertodd
Copy link
Contributor

This doesn't even properly validate PoW, let alone "SPV", as it's simply a single-block validation.

A better name would be validate_target(), as it validates that the required target has been met. To fix this I'd suggest that we just change the name, and add a #inline(always) wrapper for the old name that's marked depreciated.

@apoelstra
Copy link
Member

Agreed. This is a holdover from the ancient src/blockdata/blockchain.rs days (where there was appropriate supporting code to actually compute the expected difficulty). This was removed in March and perhaps this function should've been removed too. Oh well.

The old supporting code was moved to https://github.com/tamasblummer/rust-bitcoin-chain which AFAIK is the only place this function is used.

Davidson-Souza pushed a commit to Davidson-Souza/rust-bitcoin that referenced this issue Jul 12, 2023
Updating libraries and small code improvements
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 a pull request may close this issue.

2 participants