index: document TxoSpenderIndex::FindSpender

Hard to know what a returned std::Expected(std::nullopt) mean
if it is not documented anywhere.
This commit is contained in:
furszy 2026-03-05 17:29:27 -03:00 committed by Fabian Jahr
parent f8b9595aaa
commit 15c4889497
No known key found for this signature in database
GPG Key ID: F13D1E9D890798CD

View File

@ -55,6 +55,16 @@ protected:
public:
explicit TxoSpenderIndex(std::unique_ptr<interfaces::Chain> 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::optional<TxoSpender>, std::string> FindSpender(const COutPoint& txo) const;
};