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);
49 extern std::unique_ptr<TxIndex>
g_txindex;
51 #endif // BITCOIN_INDEX_TXINDEX_H std::shared_ptr< const CTransaction > CTransactionRef
bool AllowPrune() const override
const std::unique_ptr< DB > m_db
Access to the txindex database (indexes/txindex/)
The database stores a block locator of the chain the database is synced to so that the index can effi...
Block data sent with blockConnected, blockDisconnected notifications.
Base class for indices of blockchain data.
bool FindTx(const uint256 &tx_hash, uint256 &block_hash, CTransactionRef &tx) const
Look up a transaction by hash.
BaseIndex::DB & GetDB() const override
virtual ~TxIndex() override
bool CustomAppend(const interfaces::BlockInfo &block) override
Write update index entries for a newly connected block.
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.
static constexpr bool DEFAULT_TXINDEX
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.
TxIndex is used to look up transactions included in the blockchain by hash.