 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_INDEX_TXINDEX_H
6 #define BITCOIN_INDEX_TXINDEX_H
21 const std::unique_ptr<DB>
m_db;
28 const char*
GetName()
const override {
return "txindex"; }
32 explicit TxIndex(
size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
47 extern std::unique_ptr<TxIndex>
g_txindex;
49 #endif // BITCOIN_INDEX_TXINDEX_H
Access to the txindex database (indexes/txindex/)
bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override
Write update index entries for a newly connected block.
const std::unique_ptr< DB > m_db
std::shared_ptr< const CTransaction > CTransactionRef
Base class for indices of blockchain data.
virtual ~TxIndex() override
const char * GetName() const override
Get the name of the index for display in logs.
BaseIndex::DB & GetDB() const override
bool FindTx(const uint256 &tx_hash, uint256 &block_hash, CTransactionRef &tx) const
Look up a transaction by hash.
TxIndex is used to look up transactions included in the blockchain by hash.
The database stores a block locator of the chain the database is synced to so that the index can effi...
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(size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
Constructs the index, which becomes available to be queried.