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

Client block header #862

Merged
merged 3 commits into from
Sep 28, 2019
Merged

Client block header #862

merged 3 commits into from
Sep 28, 2019

Conversation

tynes
Copy link
Member

@tynes tynes commented Sep 26, 2019

  • Adds getBlockHeader method to the NodeClient
  • Adds header method to bcoin-cli
  • Updates tests to use getBlockHeader over get('/header')

Port of bcoin-org/bclient#21

@codecov-io

This comment has been minimized.

Copy link
Contributor

@braydonf braydonf left a comment

Choose a reason for hiding this comment

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

LGTM

@braydonf
Copy link
Contributor

braydonf commented Sep 27, 2019

One thing I noticed when testing, there is an oddity with the behavior for hashes that are not 32 bytes, because of this pattern:

if (hash.length !== 64)
  hash = parseInt(hash, 10);

For example if hash is 3e364f28633de01e6707bb2a4eb78334dbd1f4cb it will become 3, and actually return a block at height 3. This is a pattern that is used several places, so I'll open an issue for it.

@jonajosejg
Copy link

Good find

braydonf added a commit that referenced this pull request Sep 28, 2019
@braydonf braydonf merged commit 40dac00 into bcoin-org:master Sep 28, 2019
@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
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.

4 participants