← Watch feed
index: document TxoSpenderIndex::FindSpender
What changed, and why it matters
This commit only adds a comment explaining what a particular function returns in different situations. No code behavior was changed, so it cannot introduce or fix a security issue.
Recommended action
No action needed; this is a non-functional documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a Doxygen-style documentation block for TxoSpenderIndex::FindSpender. It clarifies the meaning of std::nullopt, std::optional
Changed components
src/index/txospenderindex.hInspect captured patch +10 / −0
diff --git a/src/index/txospenderindex.h b/src/index/txospenderindex.h
index 42e25bcd..35ca30d8 100644
--- a/src/index/txospenderindex.h
+++ b/src/index/txospenderindex.h
@@ -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;
};
Risk score
Our methodology →Why this scored 15/100
Human-validated context
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
No validated notes yet.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.