5#ifndef BITCOIN_INDEX_TXINDEX_H
6#define BITCOIN_INDEX_TXINDEX_H
23 const std::unique_ptr<DB>
m_db;
34 explicit TxIndex(std::unique_ptr<interfaces::Chain> chain,
size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
The database stores a block locator of the chain the database is synced to so that the index can effi...
Base class for indices of blockchain data.
Access to the txindex database (indexes/txindex/)
TxIndex is used to look up transactions included in the blockchain by hash.
bool FindTx(const uint256 &tx_hash, uint256 &block_hash, CTransactionRef &tx) const
Look up a transaction by hash.
BaseIndex::DB & GetDB() const override
bool CustomAppend(const interfaces::BlockInfo &block) override
Write update index entries for a newly connected block.
TxIndex(std::unique_ptr< interfaces::Chain > chain, size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
Constructs the index, which becomes available to be queried.
virtual ~TxIndex() override
bool AllowPrune() const override
const std::unique_ptr< DB > m_db
std::shared_ptr< const CTransaction > CTransactionRef
Block data sent with blockConnected, blockDisconnected notifications.
static constexpr bool DEFAULT_TXINDEX
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.