-
Notifications
You must be signed in to change notification settings - Fork 282
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
node/http: get header by hash/height #210
node/http: get header by hash/height #210
Conversation
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
=========================================
+ Coverage 52.99% 53.1% +0.11%
=========================================
Files 129 129
Lines 35773 35782 +9
Branches 6032 6033 +1
=========================================
+ Hits 18957 19003 +46
+ Misses 16816 16779 -37
Continue to review full report at Codecov.
|
Updated to match latest changes https://github.com/bcoin-org/bcoin/pull/808/files |
Accidentally closed when pruning old git branches. Still open for review, but not critical to have merged now. |
77be96b
to
e43e107
Compare
PR to docs here handshake-org/handshake-org.github.io#68 |
|
||
it('should fetch null for block header that does not exist', async () => { | ||
// many blocks in the future | ||
const header = await nclient.get(`/header/${40000}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why is 40000
in braces?
This could be foolproof by getting chain tip height and adding any value > 1
But no change needed really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, would be nice to have CLI update in hs-client as well.
Here is the method added to
|
It can be useful to query for block headers directly without needing to query for full blocks.
Less disk i/o and less bandwidth would be needed when querying for just the block header.
It will also work for nodes in SPV mode.
This is a port of a PR to bcoin here https://github.com/bcoin-org/bcoin/pull/808/files