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"; }
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.
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
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
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.