[#CCoinsViewCache-SpendCoin]
= xref:CCoinsViewCache.adoc[CCoinsViewCache]::SpendCoin
:relfileprefix: ../
:mrdocs:

Spend a coin&period; Pass moveto in order to get the deleted data&period; If no unspent output exists for the passed outpoint, this call has no effect&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
SpendCoin(
    xref:COutPoint.adoc[COutPoint] const& outpoint,
    xref:Coin-04.adoc[Coin]* moveto = nullptr);
----

== Return Value

True if a coin was found and spent&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *outpoint*
| The outpoint of the coin to spend&period;
| *moveto*
| If non&hyphen;null, receives the spent coin&apos;s data&period;
|===


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