[#wallet-CWallet-SetSpentKeyState]
= xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::SetSpentKeyState
:relfileprefix: ../../
:mrdocs:

Record whether the key behind a transaction output has been spent&period;

== Synopsis

Declared in `&lt;wallet&sol;wallet&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f94fde04c28), requires&lowbar;capability(0x7f95061a7968), requires&lowbar;capability(0x7f94f2b78478), requires&lowbar;capability(0x7f94f0cf7108), requires&lowbar;capability(0x7f94fee39af8)&rsqb;&rsqb;
void
SetSpentKeyState(
    xref:wallet/WalletBatch.adoc[WalletBatch]& batch,
    xref:Txid.adoc[Txid] const& hash,
    unsigned int n,
    bool used,
    std::set&lt;CTxDestination&gt;& tx&lowbar;destinations);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *batch*
| The database batch to write through&period;
| *hash*
| The txid of the output&period;
| *n*
| The output index within the transaction&period;
| *used*
| Whether the key is marked as used&sol;spent&period;
| *tx&lowbar;destinations*
| Set to the destinations affected by the update&period;
|===


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