Changeset View
Changeset View
Standalone View
Standalone View
src/index/base.h
Show All 20 Lines | |||||
/** | /** | ||||
* Base class for indices of blockchain data. This implements | * Base class for indices of blockchain data. This implements | ||||
* CValidationInterface and ensures blocks are indexed sequentially according | * CValidationInterface and ensures blocks are indexed sequentially according | ||||
* to their position in the active chain. | * to their position in the active chain. | ||||
*/ | */ | ||||
class BaseIndex : public CValidationInterface { | class BaseIndex : public CValidationInterface { | ||||
protected: | protected: | ||||
/** | |||||
* The database stores a block locator of the chain the database is synced | |||||
* to so that the TxIndex 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. | |||||
*/ | |||||
class DB : public CDBWrapper { | class DB : public CDBWrapper { | ||||
public: | public: | ||||
DB(const fs::path &path, size_t n_cache_size, bool f_memory = false, | DB(const fs::path &path, size_t n_cache_size, bool f_memory = false, | ||||
bool f_wipe = false, bool f_obfuscate = false); | bool f_wipe = false, bool f_obfuscate = false); | ||||
/// Read block locator of the chain that the txindex is in sync with. | /// Read block locator of the chain that the txindex is in sync with. | ||||
bool ReadBestBlock(CBlockLocator &locator) const; | bool ReadBestBlock(CBlockLocator &locator) const; | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |