[#wallet-SelectCoins] = xref:wallet.adoc[wallet]::SelectCoins :relfileprefix: ../ :mrdocs: Select all coins from coin_control, and if coin_control 'm_allow_other_inputs=true', call 'AutomaticCoinSelection' to select a set of coins such that nTargetValue ‐ pre_set_inputs.total_amount is met. == Synopsis Declared in `<wallet/spend.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[requires_capability(0x7f2e1e6570c8)]] xref:util/Result.adoc[util::Result<SelectionResult>] SelectCoins( xref:wallet/CWallet.adoc[CWallet] const& wallet, xref:wallet/CoinsResult.adoc[CoinsResult]& available_coins, xref:wallet/CoinsResult.adoc[CoinsResult] const& pre_set_inputs, xref:CAmount.adoc[CAmount] const& nTargetValue, xref:wallet/CCoinControl.adoc[CCoinControl] const& coin_control, xref:wallet/CoinSelectionParams.adoc[CoinSelectionParams] const& coin_selection_params); ---- == Return Value If successful, a SelectionResult containing the selected coins, otherwise an error. == Parameters [cols="1,4"] |=== | Name| Description | *wallet* | The wallet which provides data necessary to spend the selected coins. | *available_coins* | The coins, organized by OutputType, available for automatic selection. | *pre_set_inputs* | Inputs already chosen through coin control that must be included. | *nTargetValue* | The target value to be met by the selected coins. | *coin_control* | Coin control settings governing manual and automatic selection. | *coin_selection_params* | Parameters for this coin selection such as feerates and spend options. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#