[#CCoinsViewMemPool-GetCoin]
= xref:CCoinsViewMemPool.adoc[CCoinsViewMemPool]::GetCoin
:relfileprefix: ../
:mrdocs:

GetCoin, returning whether it exists and is not spent&period; Also updates m&lowbar;non&lowbar;base&lowbar;coins if the coin is not fetched from base&period; May populate the base view on cache misses&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
std::optional&lt;Coin&gt;
GetCoin(xref:COutPoint.adoc[COutPoint] const& outpoint) const override;
----

== Return Value

The coin if it exists and is unspent, otherwise std&colon;&colon;nullopt&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *outpoint*
| The outpoint to look up&period;
|===


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