Changeset View
Changeset View
Standalone View
Standalone View
src/index/txindex.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | protected: | ||||
/// Write update index entries for a newly connected block. | /// Write update index entries for a newly connected block. | ||||
virtual bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) { | virtual bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) { | ||||
return true; | return true; | ||||
} | } | ||||
virtual BaseIndexDB &GetDB() const = 0; | virtual BaseIndexDB &GetDB() const = 0; | ||||
/// Get the name of the index for display in logs. | |||||
virtual const char *GetName() const = 0; | |||||
public: | public: | ||||
/// Destructor interrupts sync thread if running and blocks until it exits. | /// Destructor interrupts sync thread if running and blocks until it exits. | ||||
virtual ~BaseIndex(); | virtual ~BaseIndex(); | ||||
/// Blocks the current thread until the index is caught up to the current | /// Blocks the current thread until the index is caught up to the current | ||||
/// state of the block chain. This only blocks if the index has gotten in | /// state of the block chain. This only blocks if the index has gotten in | ||||
/// sync once and only needs to process blocks in the ValidationInterface | /// sync once and only needs to process blocks in the ValidationInterface | ||||
/// queue. If the index is catching up from far behind, this method does | /// queue. If the index is catching up from far behind, this method does | ||||
Show All 22 Lines | |||||
protected: | protected: | ||||
/// Override base class init to migrate from old database. | /// Override base class init to migrate from old database. | ||||
bool Init() override; | bool Init() override; | ||||
bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override; | bool WriteBlock(const CBlock &block, const CBlockIndex *pindex) override; | ||||
BaseIndexDB &GetDB() const override; | BaseIndexDB &GetDB() const override; | ||||
const char *GetName() const override { return "txindex"; } | |||||
public: | public: | ||||
/// Constructs the index, which becomes available to be queried. | /// Constructs the index, which becomes available to be queried. | ||||
explicit TxIndex(std::unique_ptr<TxIndexDB> db); | explicit TxIndex(std::unique_ptr<TxIndexDB> db); | ||||
/// Look up a transaction by hash. | /// Look up a transaction by hash. | ||||
/// | /// | ||||
/// @param[in] tx_hash The hash of the transaction to be returned. | /// @param[in] tx_hash The hash of the transaction to be returned. | ||||
/// @param[out] block_hash The hash of the block the transaction is found | /// @param[out] block_hash The hash of the block the transaction is found | ||||
Show All 11 Lines |