Database key types and constants for the transaction index.
Description
Database layout:
['x', hash prefix, block seq, tx offset]‐> (empty) ['s', block seq]‐> block hash ['h', block hash]‐> block seq ["next_block_seq"]‐> next block seq to assign ["txid_hash_salt"]‐> txid hasher salt ["best_block_v2"]‐> current sync locator ['t', txid]‐> legacy CDiskTxPos ['B']‐> legacy sync locator
Types
Name |
Description |
Key for looking up the sequence number assigned to the block with the given hash. |
|
Key for looking up the hash of the block with the given sequence number. |
|
The location of a transaction: the sequence number of the block that contains it and the transaction's serialized byte offset from the start of that block (including the header), so the on‐disk position is simply block_data_pos + tx_offset_in_block. |
|
Hashed txindex key: a truncated txid hash prefix plus the block position. |
Type Aliases
Name |
Description |
Integer type holding the truncated txid hash prefix of a key. |
Functions
Name |
Description |
Compute the txid‐hash key prefix for a transaction. |
|
Key of a legacy (pre‐hashing) txindex row: the full txid under the 't' prefix. |
|
Compare two positions for equality by block sequence and offset. |
Variables
Name |
Description |
Serialized size of a block header, the offset of the first byte after it. |
|
Key holding the sync locator for the current (v2) index format. |
|
Key prefix mapping a block hash to its sequence number. |
|
Key prefix mapping a block sequence number to its block hash. |
|
Key holding the next block sequence number to assign. |
|
Key holding the salt used to hash txids. |
|
Prefix of a legacy (pre‐hashing) txindex row. |
|
Key prefix for a hashed txindex row keyed by txid hash prefix and position. |
|
Empty value of a hashed txindex row, whose position is encoded in its key. |
|
Number of leading txid‐hash bytes kept in a hashed txindex key. |
Created with MrDocs