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