![]() |
Bitcoin Core 31.99.0
P2P Digital Currency
|
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. More...
#include <base.h>
Public Member Functions | |
| DB (const fs::path &path, size_t n_cache_size, bool f_memory=false, bool f_wipe=false, bool f_obfuscate=false, bool f_bloom=true) | |
| virtual | ~DB ()=default |
| virtual CBlockLocator | ReadBestBlock () const |
| Read block locator of the chain that the index is in sync with. More... | |
| virtual void | WriteBestBlock (CDBBatch &batch, const CBlockLocator &locator) |
| Write block locator of the chain that the index is in sync with. More... | |
Public Member Functions inherited from CDBWrapper | |
| CDBWrapper (const DBParams ¶ms) | |
| ~CDBWrapper () | |
| CDBWrapper (const CDBWrapper &)=delete | |
| CDBWrapper & | operator= (const CDBWrapper &)=delete |
| template<typename K , typename V > | |
| bool | Read (const K &key, V &value) const |
| template<typename K , typename V > | |
| void | Write (const K &key, const V &value, bool fSync=false) |
| template<typename K > | |
| bool | Exists (const K &key) const |
| template<typename K > | |
| void | Erase (const K &key, bool fSync=false) |
| void | WriteBatch (CDBBatch &batch, bool fSync=false) |
| void | CompactFull () |
| Perform a blocking full compaction of the underlying LevelDB. More... | |
| std::optional< std::string > | GetProperty (const std::string &property) const |
| Return a LevelDB property value, if available. More... | |
| size_t | DynamicMemoryUsage () const |
| CDBIterator * | NewIterator () |
| bool | IsEmpty () |
| Return true if the database managed by this class contains no entries. More... | |
| template<typename K > | |
| size_t | EstimateSize (const K &key_begin, const K &key_end) const |
Additional Inherited Members | |
Static Public Member Functions inherited from CDBWrapper | |
| static bool | HasKeyStartingWith (const fs::path &path, uint8_t prefix) |
| Probe an unopened database for a key prefix. More... | |
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.
| BaseIndex::DB::DB | ( | const fs::path & | path, |
| size_t | n_cache_size, | ||
| bool | f_memory = false, |
||
| bool | f_wipe = false, |
||
| bool | f_obfuscate = false, |
||
| bool | f_bloom = true |
||
| ) |
|
virtualdefault |
|
virtual |
Read block locator of the chain that the index is in sync with.
Note, the returned locator will be empty if no record exists.
Reimplemented in TxIndex::DB.
Definition at line 79 of file base.cpp.
|
virtual |
Write block locator of the chain that the index is in sync with.
Reimplemented in TxIndex::DB.
Definition at line 91 of file base.cpp.