forked from romanz/electrs
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the
/headers[/:from_hash[/:count]]
endpoint
Add a new endpoint to download headers in bulk, up to 2000 with a single request. Headers are returned in binary form, with the VarInt-encoded number of items in the body preceeding them. By default `from_hash` is the current best hash, but a different starting block can be specified. The returned list goes "backwards" returning the `count - 1` blocks *before* `from_hash` plus the header of `from_hash` itself. This allows caching the response indefinitely, since it's guaranteed that the headers that come before a given block will never change. Returns an error if `from_hash` is not a valid block or it isn't found in the blockchain. If `count` is greater than the limit of `2000` it will be silently capped to said value.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters