Changeset View
Changeset View
Standalone View
Standalone View
src/index/base.h
Show All 32 Lines | protected: | ||||
* because blocks and block index entries may not be flushed to disk until | * because blocks and block index entries may not be flushed to disk until | ||||
* after this database is updated. | * 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 index is in sync with. | ||||
bool ReadBestBlock(CBlockLocator &locator) const; | bool ReadBestBlock(CBlockLocator &locator) const; | ||||
/// Write block locator of the chain that the txindex is in sync with. | /// Write block locator of the chain that the index is in sync with. | ||||
void WriteBestBlock(CDBBatch &batch, const CBlockLocator &locator); | void WriteBestBlock(CDBBatch &batch, const CBlockLocator &locator); | ||||
}; | }; | ||||
private: | private: | ||||
/// Whether the index is in sync with the main chain. The flag is flipped | /// Whether the index is in sync with the main chain. The flag is flipped | ||||
/// from false to true once, after which point this starts processing | /// from false to true once, after which point this starts processing | ||||
/// ValidationInterface notifications to stay in sync. | /// ValidationInterface notifications to stay in sync. | ||||
std::atomic<bool> m_synced{false}; | std::atomic<bool> m_synced{false}; | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |