Shared database key types for blockfilterindex and coinstatsindex.
Description
Index data is usually indexed by height, but in case of a reorg, entries of blocks no longer in the main chain will be copied to a hash index by which they can still be queried. Keys for the height index have the type [DB_BLOCK_HEIGHT, uint32 (BE)]. The height is represented as big‐endian so that sequential reads of filters by height are fast. Keys for the hash index have the type [DB_BLOCK_HASH, uint256].
Types
Name |
Description |
Database key for an index entry looked up by block hash. |
|
Database key for an index entry looked up by block height. |
Functions
Name |
Description |
Copy an index entry from the height index to the hash index. |
|
Look up a single index entry for a block, trying the height index then the hash index. |
Variables
Name |
Description |
Key prefix byte identifying an entry in the hash index. |
|
Key prefix byte identifying an entry in the height index. |
Created with MrDocs