5#ifndef BITCOIN_INDEX_TXINDEX_H
6#define BITCOIN_INDEX_TXINDEX_H
43 const std::unique_ptr<DB>
m_db;
57 explicit TxIndex(std::unique_ptr<interfaces::Chain> chain,
size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
66 std::optional<TxIndexResult>
FindTx(
const Txid& tx_hash)
const;
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.
BaseIndex::DB & GetDB() const override
std::optional< TxIndexResult > FindTx(const Txid &tx_hash) const
Look up a transaction by hash.
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::optional< TxIndexResult > FindLegacyTx(const Txid &tx_hash) const
Look up a transaction among the legacy (full-txid) entries.
friend class txindex_tests::TxIndexTest
std::shared_ptr< const CTransaction > CTransactionRef
A found transaction and the hash of the block that contains it.
Block data sent with blockConnected, blockDisconnected notifications.
constexpr bool DEFAULT_TXINDEX
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.