From 15c4889497b96037e41019a8f43090af841b36ec Mon Sep 17 00:00:00 2001 From: furszy Date: Thu, 5 Mar 2026 17:29:27 -0300 Subject: [PATCH] index: document TxoSpenderIndex::FindSpender Hard to know what a returned std::Expected(std::nullopt) mean if it is not documented anywhere. --- src/index/txospenderindex.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/index/txospenderindex.h b/src/index/txospenderindex.h index 42e25bcd7fd..35ca30d8b31 100644 --- a/src/index/txospenderindex.h +++ b/src/index/txospenderindex.h @@ -55,6 +55,16 @@ protected: public: explicit TxoSpenderIndex(std::unique_ptr chain, size_t n_cache_size, bool f_memory = false, bool f_wipe = false); + /** + * Search the index for a transaction that spends the given outpoint. + * + * @param[in] txo The outpoint to search for. + * + * @return std::nullopt if the outpoint has not been spent on-chain. + * std::optional{TxoSpender} if the output has been spent on-chain. Contains the spending transaction + * and the block it was confirmed in. + * util::Unexpected{error} if something unexpected happened (i.e. disk or deserialization error). + */ util::Expected, std::string> FindSpender(const COutPoint& txo) const; };