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

Select coins using the CoinGrinder deterministic search algorithm&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:util/Result.adoc[util::Result&lt;SelectionResult&gt;]
CoinGrinder(
    std::vector&lt;OutputGroup&gt;& utxo&lowbar;pool,
    xref:CAmount.adoc[CAmount] const& selection&lowbar;target,
    xref:CAmount.adoc[CAmount] change&lowbar;target,
    int max&lowbar;selection&lowbar;weight);
----

== Return Value

If successful, a valid SelectionResult, otherwise util&colon;&colon;Error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *utxo&lowbar;pool*
| The output groups eligible for selection&period;
| *selection&lowbar;target*
| The target value to select for&period;
| *change&lowbar;target*
| The minimum change amount to target&period;
| *max&lowbar;selection&lowbar;weight*
| The maximum allowed weight for a valid selection&period;
|===


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