5 #ifndef BITCOIN_INDEX_TXINDEX_H 6 #define BITCOIN_INDEX_TXINDEX_H 23 const std::unique_ptr<DB>
m_db;
33 const char*
GetName()
const override {
return "txindex"; }
37 explicit TxIndex(
size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
52 extern std::unique_ptr<TxIndex>
g_txindex;
54 #endif // BITCOIN_INDEX_TXINDEX_H bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override
Write update index entries for a newly connected block.
const char * GetName() const override
Get the name of the index for display in logs.
const std::unique_ptr< DB > m_db
std::shared_ptr< const CTransaction > CTransactionRef
bool Init() override
Override base class init to migrate from old database.
Access to the txindex database (indexes/txindex/)
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
TxIndex(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
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.
The block chain is a tree shaped structure starting with the genesis block at the root...
TxIndex is used to look up transactions included in the blockchain by hash.