FetchBlockHeaders returns the raw serialized bytes for the block headers identified by the given hashes. The raw bytes are in the format returned by Serialize on a wire.BlockHeader.

It is highly recommended to use this function (or FetchBlockHeader) to obtain block headers over the FetchBlockRegion(s) functions since it provides the backend drivers the freedom to perform very specific optimizations which can result in significant speed advantages when working with headers.

Furthermore, depending on the specific implementation, this function can be more efficient for bulk loading multiple block headers than loading them one-by-one with FetchBlockHeader.

The interface contract guarantees at least the following errors will be returned (other implementation-specific errors are possible):

- ErrBlockNotFound if any of the request block hashes do not exist
- ErrTxClosed if the transaction has already been closed
- ErrCorruption if the database has somehow become corrupted

NOTE: The data returned by this function is only valid during a database transaction. Attempting to access it after a transaction has ended results in undefined behavior. This constraint prevents additional data copies and allows support for memory-mapped database implementations.

FetchBlockHeaders is referenced in 2 repositories