The database stores a block locator of the chain the database is synced to so that the index can efficiently determine the point it last stopped at. A locator is used instead of a simple hash of the chain tip because blocks and block index entries may not be flushed to disk until after this database is updated.
Synopsis
Declared in <index/base.h>
class DB
: public CDBWrapper
Base Classes
Name |
Description |
Wraps a LevelDB database, providing typed, serialized key‐value access. |
Member Functions
Name |
Description |
|
Open the index database at the given path. |
|
Close the database and release its resources. |
|
Copy assignment is disabled. |
Perform a blocking full compaction of the underlying LevelDB. |
|
Get an estimate of LevelDB memory usage (in bytes). |
|
Removes the value stored under the given key. |
|
Estimates the on‐disk size of the entries in the given key range. |
|
Checks whether a value is stored under the given key. |
|
Return a LevelDB property value, if available. |
|
Return true if the database managed by this class contains no entries. |
|
Creates a new iterator over the database. The caller owns the returned iterator. |
|
Reads and de‐obfuscates the value stored under the given key. |
|
|
Read block locator of the chain that the index is in sync with. Note, the returned locator will be empty if no record exists. |
Writes a single key‐value pair to the database. |
|
Atomically applies all writes and erases queued in a batch. |
|
|
Write block locator of the chain that the index is in sync with. |
Static Member Functions
Name |
Description |
Probe an unopened database for a key prefix. Return true if a database at path exists and contains at least 1 entry beginning with prefix; missing or empty databases return false, and database errors throw dbwrapper_error. |
Non-Member Functions
Name |
Description |
|
Work around circular dependency, as well as for testing in dbwrapper_tests. Database obfuscation should be considered an implementation detail of the specific database. |
Look up a single index entry for a block, trying the height index then the hash index. |
Created with MrDocs