The set of inputs chosen by a coin selection algorithm, along with its metrics.
Synopsis
Declared in <wallet/coinselection.h>
struct SelectionResult;
Member Functions
Name |
Description |
|
Constructors |
Add all outputs of a group to the selection. |
|
Add a set of inputs to the selection. |
|
Remove all selected inputs and reset the result. |
|
Return the algorithm that produced this result. |
|
Get m_algo_completed |
|
Get the amount for the change output after paying needed fees. |
|
Get m_selected_inputs |
|
Return the sum of the effective values of the selected inputs. |
|
Get the sum of the input values |
|
Get selections_evaluated |
|
Get the vector of COutputs that will be used to fill in a CTransaction's vin |
|
Return the selection target. |
|
Return the total ancestor bump fees of the selected inputs. |
|
Return the previously computed waste for this result. |
|
Return the total weight of the selected inputs. |
|
Combines the |
|
Calculates and stores the waste for this result given the cost of change and the opportunity cost of spending these inputs now vs in the future. If change exists, waste = change_cost + inputs * (effective_feerate ‐ long_term_feerate) ‐ bump_fee_group_discount If no change, waste = excess + inputs * (effective_feerate ‐ long_term_feerate) ‐ bump_fee_group_discount where excess = selected_effective_value ‐ target change_cost = effective_feerate * change_output_size + long_term_feerate * change_spend_size |
|
Tracks that algorithm was able to exhaustively search the entire combination space before hitting limit of tries |
|
How much individual inputs overestimated the bump fees for shared ancestries |
|
Record the number of selections that were evaluated |
|
Order results by preference for choosing between selections. |
Non-Member Functions
Name |
Description |
Attempt to find a valid input set that preserves privacy by not mixing OutputTypes. |
|
Select a set of coins such that nTargetValue is met; never select unconfirmed coins if they are not ours |
|
Attempt to find a valid input set that meets the provided eligibility filter and target. Multiple coin selection algorithms will be run and the input set that produces the least waste (according to the waste metric) will be chosen. |
|
Select coins using the CoinGrinder deterministic search algorithm. |
|
Select coins using the original Knapsack approximation, used as a fallback. |
|
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. |
|
Select coins using the Branch and Bound algorithm to find a changeless solution. |
|
Select coins by Single Random Draw (SRD). SRD selects eligible OutputGroups from a shuffled ordering until the effective value of the input set suffices to create the recipient outputs and a change output with an amount of at least CHANGE_LOWER. While the maximum selection weight is exceeded during selection, the OutputGroup with the lowest effective value is dropped from the selection before additional OutputGroups are selected. Due to this greedy approach, SRD can fail to discover possible solutions in pathological cases. |
Created with MrDocs