Changeset View
Changeset View
Standalone View
Standalone View
src/index/txindex.cpp
Show All 13 Lines | |||||
#include <validation.h> | #include <validation.h> | ||||
constexpr char DB_BEST_BLOCK = 'B'; | constexpr char DB_BEST_BLOCK = 'B'; | ||||
constexpr char DB_TXINDEX = 't'; | constexpr char DB_TXINDEX = 't'; | ||||
constexpr char DB_TXINDEX_BLOCK = 'T'; | constexpr char DB_TXINDEX_BLOCK = 'T'; | ||||
std::unique_ptr<TxIndex> g_txindex; | std::unique_ptr<TxIndex> g_txindex; | ||||
/** | /** Access to the txindex database (indexes/txindex/) */ | ||||
* Access to the txindex database (indexes/txindex/) | |||||
* | |||||
* 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 TxIndex::DB : public BaseIndex::DB { | class TxIndex::DB : public BaseIndex::DB { | ||||
public: | public: | ||||
explicit DB(size_t n_cache_size, bool f_memory = false, | explicit DB(size_t n_cache_size, bool f_memory = false, | ||||
bool f_wipe = false); | bool f_wipe = false); | ||||
/// Read the disk location of the transaction data with the given ID. | /// Read the disk location of the transaction data with the given ID. | ||||
/// Returns false if the transaction ID is not indexed. | /// Returns false if the transaction ID is not indexed. | ||||
bool ReadTxPos(const TxId &txid, CDiskTxPos &pos) const; | bool ReadTxPos(const TxId &txid, CDiskTxPos &pos) const; | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |