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>

[[requires_capability(0x7f2e1e6570c8)]]
util::Result<SelectionResult>
SelectCoins(
    CWallet const& wallet,
    CoinsResult& available_coins,
    CoinsResult const& pre_set_inputs,
    CAmount const& nTargetValue,
    CCoinControl const& coin_control,
    CoinSelectionParams const& coin_selection_params);

Return Value

If successful, a SelectionResult containing the selected coins, otherwise an error.

Parameters

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.

Created with MrDocs