6#ifndef BITCOIN_INDEX_TXOSPENDERINDEX_H
7#define BITCOIN_INDEX_TXOSPENDERINDEX_H
40 std::unique_ptr<BaseIndex::DB>
m_db;
43 void WriteSpenderInfos(
const std::vector<std::pair<COutPoint, CDiskTxPos>>& items);
44 void EraseSpenderInfos(
const std::vector<std::pair<COutPoint, CDiskTxPos>>& items);
57 explicit TxoSpenderIndex(std::unique_ptr<interfaces::Chain> chain,
size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
The database stores a block locator of the chain the database is synced to so that the index can effi...
Base class for indices of blockchain data.
An outpoint - a combination of a transaction hash and an index n into its vout.
TxoSpenderIndex is used to look up which transaction spent a given output.
void EraseSpenderInfos(const std::vector< std::pair< COutPoint, CDiskTxPos > > &items)
std::pair< uint64_t, uint64_t > m_siphash_key
TxoSpenderIndex(std::unique_ptr< interfaces::Chain > chain, size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
bool AllowPrune() const override
std::unique_ptr< BaseIndex::DB > m_db
bool CustomRemove(const interfaces::BlockInfo &block) override
Rewind index by one block during a chain reorg.
util::Expected< TxoSpender, std::string > ReadTransaction(const CDiskTxPos &pos) const
util::Expected< std::optional< TxoSpender >, std::string > FindSpender(const COutPoint &txo) const
interfaces::Chain::NotifyOptions CustomOptions() override
Return custom notification options for index.
void WriteSpenderInfos(const std::vector< std::pair< COutPoint, CDiskTxPos > > &items)
BaseIndex::DB & GetDB() const override
bool CustomAppend(const interfaces::BlockInfo &block) override
Write update index entries for a newly connected block.
The util::Expected class provides a standard way for low-level functions to return either error value...
std::shared_ptr< const CTransaction > CTransactionRef
Block data sent with blockConnected, blockDisconnected notifications.
Options specifying which chain notifications are required.
static constexpr bool DEFAULT_TXOSPENDERINDEX
std::unique_ptr< TxoSpenderIndex > g_txospenderindex
The global txo spender index. May be null.