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 std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:408
Definition: txindex.cpp:53
const std::unique_ptr< DB > m_db
Definition: txindex.h:20
bool FindTx(const uint256 &tx_hash, uint256 &block_hash, CTransactionRef &tx) const
Definition: txindex.cpp:263
const char * GetName() const override
Get the name of the index for display in logs.
Definition: txindex.h:33
bool Init() override
Override base class init to migrate from old database.
Definition: txindex.cpp:232
Definition: uint256.h:121
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.
Definition: txindex.cpp:17
bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override
Write update index entries for a newly connected block.
Definition: txindex.cpp:246
virtual ~TxIndex() override
Definition: txindex.cpp:230
TxIndex(size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
Constructs the index, which becomes available to be queried.
Definition: txindex.cpp:226
BaseIndex::DB & GetDB() const override
Definition: txindex.cpp:261