[#AccessByTxid]
= AccessByTxid
:mrdocs:

Utility function to find any unspent output with a given txid&period; This function can be quite expensive because in the event of a transaction which is not found in the cache, it can cause up to MAX&lowbar;OUTPUTS&lowbar;PER&lowbar;BLOCK lookups to database, so it should be used with care&period;

== Synopsis

Declared in `&lt;coins&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:Coin-04.adoc[Coin] const&
AccessByTxid(
    xref:CCoinsViewCache.adoc[CCoinsViewCache] const& cache,
    xref:Txid.adoc[Txid] const& txid);
----

== Return Value

Reference to the first unspent output found, or an empty coin if none exists&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cache*
| Cache to search for an unspent output&period;
| *txid*
| Transaction ID to find an unspent output for&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
