[#wallet-CoinSelectionParams-2constructor-02]
= xref:wallet.adoc[wallet]::xref:wallet/CoinSelectionParams.adoc[CoinSelectionParams]::CoinSelectionParams
:relfileprefix: ../../
:mrdocs:

Construct coin selection parameters with fully specified fees and sizes&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
CoinSelectionParams(
    xref:FastRandomContext.adoc[FastRandomContext]& rng&lowbar;fast,
    int change&lowbar;output&lowbar;size,
    int change&lowbar;spend&lowbar;size,
    xref:CAmount.adoc[CAmount] min&lowbar;change&lowbar;target,
    xref:CFeeRate.adoc[CFeeRate] effective&lowbar;feerate,
    xref:CFeeRate.adoc[CFeeRate] long&lowbar;term&lowbar;feerate,
    xref:CFeeRate.adoc[CFeeRate] discard&lowbar;feerate,
    int tx&lowbar;noinputs&lowbar;size,
    bool avoid&lowbar;partial,
    std::optional&lt;int&gt; max&lowbar;tx&lowbar;weight = std&colon;&colon;nullopt);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rng&lowbar;fast*
| Randomness source to use during coin selection&period;
| *change&lowbar;output&lowbar;size*
| Size of a change output in bytes&period;
| *change&lowbar;spend&lowbar;size*
| Size of the input spending a change output in virtual bytes&period;
| *min&lowbar;change&lowbar;target*
| Minimum change to target in the Knapsack solver and CoinGrinder&period;
| *effective&lowbar;feerate*
| Targeted feerate of the transaction being built&period;
| *long&lowbar;term&lowbar;feerate*
| Feerate estimate for spending the change output in the future&period;
| *discard&lowbar;feerate*
| Feerate below which spending a change output is not worthwhile&period;
| *tx&lowbar;noinputs&lowbar;size*
| Size of the transaction before inputs and change are added&period;
| *avoid&lowbar;partial*
| Whether to spend all or none of the outputs sharing an address&period;
| *max&lowbar;tx&lowbar;weight*
| Optional maximum weight for the transaction&period;
|===


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