Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
REST: add blockhash call, fetch blockhash by height #14353
@promag: the use case is exactly that (find a block by giving a height) (ex: https://bitcointools.jonasschnelli.ch/explorer/height/500000).
You could build it into /rest/block, but IMO we should keep it modular. I guess that is also the reason why there is a "getblock" and a "getblockhash" call on RPC.
PR is mistitled, not a "blockheader" call. This PR doesn't really seem to indicate the benefit this provides to the user. Making multiple round trips also has bad performance, if the purpose really is just querying blocks by height this indirection seems like pretextual modularity.
Changed the title (was wrong, thank @gmaxwell)
I'm happy to add a per-height accessing to
Of course, we could then add it to /rest/headers/ as well so one would fetch a single blockheader (or range of headers) per height.
I haven't made a study about use cases but the extra roundtrip made sense to me (costs for http mem only retrieval roundtrips are usually tiny).
added a commit
this pull request
Oct 7, 2018
referenced this pull request
Oct 22, 2018
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.