Bitcoin
|
#include <txindex.h>
Classes | |
class | DB |
Public Member Functions | |
TxIndex (size_t n_cache_size, bool f_memory=false, bool f_wipe=false) | |
Constructs the index, which becomes available to be queried. More... | |
virtual | ~TxIndex () override |
bool | FindTx (const uint256 &tx_hash, uint256 &block_hash, CTransactionRef &tx) const |
![]() | |
virtual | ~BaseIndex () |
Destructor interrupts sync thread if running and blocks until it exits. More... | |
bool | BlockUntilSyncedToCurrentChain () |
void | Interrupt () |
void | Start () |
void | Stop () |
Stops the instance from staying in sync with blockchain updates. More... | |
Protected Member Functions | |
bool | Init () override |
Override base class init to migrate from old database. More... | |
bool | WriteBlock (const CBlock &block, const CBlockIndex *pindex) override |
Write update index entries for a newly connected block. More... | |
BaseIndex::DB & | GetDB () const override |
const char * | GetName () const override |
Get the name of the index for display in logs. More... | |
![]() | |
void | BlockConnected (const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex, const std::vector< CTransactionRef > &txn_conflicted) override |
void | ChainStateFlushed (const CBlockLocator &locator) override |
virtual bool | CommitInternal (CDBBatch &batch) |
virtual bool | Rewind (const CBlockIndex *current_tip, const CBlockIndex *new_tip) |
![]() | |
~CValidationInterface ()=default | |
virtual void | UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) |
virtual void | TransactionAddedToMempool (const CTransactionRef &ptxn) |
virtual void | TransactionRemovedFromMempool (const CTransactionRef &ptx) |
virtual void | BlockDisconnected (const std::shared_ptr< const CBlock > &block) |
virtual void | BlockChecked (const CBlock &, const CValidationState &) |
virtual void | NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &block) |
friend | void ::RegisterValidationInterface (CValidationInterface *) |
friend | void ::UnregisterValidationInterface (CValidationInterface *) |
friend | void ::UnregisterAllValidationInterfaces () |
Private Attributes | |
const std::unique_ptr< DB > | m_db |
TxIndex is used to look up transactions included in the blockchain by hash. The index is written to a LevelDB database and records the filesystem location of each transaction by transaction hash.
|
explicit |
Constructs the index, which becomes available to be queried.
|
overridevirtual |
bool TxIndex::FindTx | ( | const uint256 & | tx_hash, |
uint256 & | block_hash, | ||
CTransactionRef & | tx | ||
) | const |
Look up a transaction by hash.
[in] | tx_hash | The hash of the transaction to be returned. |
[out] | block_hash | The hash of the block the transaction is found in. |
[out] | tx | The transaction itself. |
|
overrideprotectedvirtual |
Implements BaseIndex.
|
inlineoverrideprotectedvirtual |
Get the name of the index for display in logs.
Implements BaseIndex.
|
overrideprotectedvirtual |
Override base class init to migrate from old database.
Reimplemented from BaseIndex.
|
overrideprotectedvirtual |
Write update index entries for a newly connected block.
Reimplemented from BaseIndex.
|
private |