Commit bf26302
committed
Add the
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./headers[/:from_hash[/:count]] endpoint1 parent abfbce7 commit bf26302
2 files changed
+53
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
427 | 446 | | |
428 | 447 | | |
429 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
630 | 664 | | |
631 | 665 | | |
632 | 666 | | |
| |||
0 commit comments