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.
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.
pinheadmz
left a comment
There was a problem hiding this comment.
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