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

Parameters for one iteration of Coin Selection&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CoinSelectionParams;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CoinSelectionParams/2constructor-0d.adoc[`CoinSelectionParams`]         [.small]#[constructor]#
| Constructors
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CoinSelectionParams/change_output_size.adoc[`change&lowbar;output&lowbar;size`] 
| Size of a change output in bytes, determined by the output type&period;
| xref:wallet/CoinSelectionParams/change_spend_size.adoc[`change&lowbar;spend&lowbar;size`] 
| Size of the input to spend a change output in virtual bytes&period;
| xref:wallet/CoinSelectionParams/m_avoid_partial_spends.adoc[`m&lowbar;avoid&lowbar;partial&lowbar;spends`] 
| When true, always spend all (up to OUTPUT&lowbar;GROUP&lowbar;MAX&lowbar;ENTRIES) or none of the outputs associated with the same address&period; This helps reduce privacy leaks resulting from address reuse&period; Dust outputs are not eligible to be added to output groups and thus not considered&period;
| xref:wallet/CoinSelectionParams/m_change_fee.adoc[`m&lowbar;change&lowbar;fee`] 
| Cost of creating the change output&period;
| xref:wallet/CoinSelectionParams/m_cost_of_change.adoc[`m&lowbar;cost&lowbar;of&lowbar;change`] 
| Cost of creating the change output &plus; cost of spending the change output in the future&period;
| xref:wallet/CoinSelectionParams/m_discard_feerate.adoc[`m&lowbar;discard&lowbar;feerate`] 
| If the cost to spend a change output at the discard feerate exceeds its value, drop it to fees&period;
| xref:wallet/CoinSelectionParams/m_effective_feerate.adoc[`m&lowbar;effective&lowbar;feerate`] 
| The targeted feerate of the transaction being built&period;
| xref:wallet/CoinSelectionParams/m_include_unsafe_inputs.adoc[`m&lowbar;include&lowbar;unsafe&lowbar;inputs`] 
| When true, allow unsafe coins to be selected during Coin Selection&period; This may spend unconfirmed outputs&colon; 1) Received from other wallets, 2) replacing other txs, 3) that have been replaced&period;
| xref:wallet/CoinSelectionParams/m_long_term_feerate.adoc[`m&lowbar;long&lowbar;term&lowbar;feerate`] 
| The feerate estimate used to estimate an upper bound on what should be sufficient to spend the change output sometime in the future&period;
| xref:wallet/CoinSelectionParams/m_max_tx_weight.adoc[`m&lowbar;max&lowbar;tx&lowbar;weight`] 
| The maximum weight for this transaction&period;
| xref:wallet/CoinSelectionParams/m_min_change_target.adoc[`m&lowbar;min&lowbar;change&lowbar;target`] 
| Mininmum change to target in Knapsack solver and CoinGrinder&colon; select coins to cover the payment and at least this value of change&period;
| xref:wallet/CoinSelectionParams/m_subtract_fee_outputs.adoc[`m&lowbar;subtract&lowbar;fee&lowbar;outputs`] 
| Indicate that we are subtracting the fee from outputs
| xref:wallet/CoinSelectionParams/m_version.adoc[`m&lowbar;version`] 
| The version of the transaction we are trying to create&period;
| xref:wallet/CoinSelectionParams/min_viable_change.adoc[`min&lowbar;viable&lowbar;change`] 
| Minimum amount for creating a change output&period; If change budget is smaller than min&lowbar;change then we forgo creation of change output&period;
| xref:wallet/CoinSelectionParams/rng_fast.adoc[`rng&lowbar;fast`] 
| Randomness to use in the context of coin selection&period;
| xref:wallet/CoinSelectionParams/tx_noinputs_size.adoc[`tx&lowbar;noinputs&lowbar;size`] 
| Size of the transaction before coin selection, consisting of the header and recipient output(s), excluding the inputs and change output(s)&period;
|===



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