5#ifndef BITCOIN_INDEX_TXINDEX_H
6#define BITCOIN_INDEX_TXINDEX_H
27 const std::unique_ptr<DB>
m_db;
36 const char *
GetName()
const override {
return "txindex"; }
40 explicit TxIndex(
size_t n_cache_size,
bool f_memory =
false,
The database stores a block locator of the chain the database is synced to so that the TxIndex can ef...
Base class for indices of blockchain data.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Access to the txindex database (indexes/txindex/)
TxIndex is used to look up transactions included in the blockchain by ID.
TxIndex(size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
Constructs the index, which becomes available to be queried.
bool FindTx(const TxId &txid, BlockHash &block_hash, CTransactionRef &tx) const
Look up a transaction by identifier.
BaseIndex::DB & GetDB() const override
virtual ~TxIndex() override
bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override
Write update index entries for a newly connected block.
bool AllowPrune() const override
const std::unique_ptr< DB > m_db
const char * GetName() const override
Get the name of the index for display in logs.
std::shared_ptr< const CTransaction > CTransactionRef
A BlockHash is a unqiue identifier for a block.
A TxId is the identifier of a transaction.
static constexpr bool DEFAULT_TXINDEX
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.