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

Add Block.prototype.getParentId #761

Closed
dcousens opened this issue Mar 8, 2017 · 3 comments
Closed

Add Block.prototype.getParentId #761

dcousens opened this issue Mar 8, 2017 · 3 comments

Comments

@dcousens
Copy link
Contributor

dcousens commented Mar 8, 2017

Thoughts @afk11 ?

Or maybe we should re-think and go with a uint256 type that prints in reverse byte order... 🤷‍♂️

@afk11
Copy link
Contributor

afk11 commented Mar 13, 2017

Just had a quick look, we could do that.. if people decoded block hex I could them being confused why bitcoind can't find the prevBlock. (and the target comparison would also fail) The merkleRoot might also be worth doing as well so it's in the representation you'd compare against.

Maybe worth splitting out the header into another object at the same time? Could put things like verifyMerkleBranch on the header, leaving calculateMerkleRoot where it is for people with the full block.

Edit: don't think I've ever had a need to distinguish the hash from the reversed one, always just returned the latter

@dcousens
Copy link
Contributor Author

@afk11 you use the non-reversed hash when you're using it cryptographically... about it.

@dcousens
Copy link
Contributor Author

dcousens commented Apr 18, 2017

I don't think this is ever going to be convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants