Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
wallet::SelectionResult Struct Reference

#include <coinselection.h>

Public Member Functions

 SelectionResult (const CAmount target)
 
 SelectionResult ()=delete
 
CAmount GetSelectedValue () const
 Get the sum of the input values. More...
 
void Clear ()
 
void AddInput (const OutputGroup &group)
 
void ComputeAndSetWaste (CAmount change_cost)
 Calculates and stores the waste for this selection via GetSelectionWaste. More...
 
CAmount GetWaste () const
 
const std::set< CInputCoin > & GetInputSet () const
 Get m_selected_inputs. More...
 
std::vector< CInputCoinGetShuffledInputVector () const
 Get the vector of CInputCoins that will be used to fill in a CTransaction's vin. More...
 
bool operator< (SelectionResult other) const
 

Private Attributes

std::set< CInputCoinm_selected_inputs
 Set of inputs selected by the algorithm to use in the transaction. More...
 
const CAmount m_target
 The target the algorithm selected for. More...
 
bool m_use_effective {false}
 Whether the input values for calculations should be the effective value (true) or normal value (false) More...
 
std::optional< CAmountm_waste
 The computed waste. More...
 

Detailed Description

Definition at line 203 of file coinselection.h.

Constructor & Destructor Documentation

◆ SelectionResult() [1/2]

wallet::SelectionResult::SelectionResult ( const CAmount  target)
inlineexplicit

Definition at line 216 of file coinselection.h.

◆ SelectionResult() [2/2]

wallet::SelectionResult::SelectionResult ( )
delete

Member Function Documentation

◆ AddInput()

void wallet::SelectionResult::AddInput ( const OutputGroup group)

Definition at line 408 of file coinselection.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void wallet::SelectionResult::Clear ( )

Definition at line 402 of file coinselection.cpp.

Here is the caller graph for this function:

◆ ComputeAndSetWaste()

void wallet::SelectionResult::ComputeAndSetWaste ( CAmount  change_cost)

Calculates and stores the waste for this selection via GetSelectionWaste.

Definition at line 387 of file coinselection.cpp.

Here is the call graph for this function:

◆ GetInputSet()

const std::set< CInputCoin > & wallet::SelectionResult::GetInputSet ( ) const

Get m_selected_inputs.

Definition at line 414 of file coinselection.cpp.

Here is the caller graph for this function:

◆ GetSelectedValue()

CAmount wallet::SelectionResult::GetSelectedValue ( ) const

Get the sum of the input values.

Definition at line 397 of file coinselection.cpp.

Here is the caller graph for this function:

◆ GetShuffledInputVector()

std::vector< CInputCoin > wallet::SelectionResult::GetShuffledInputVector ( ) const

Get the vector of CInputCoins that will be used to fill in a CTransaction's vin.

Definition at line 419 of file coinselection.cpp.

Here is the call graph for this function:

◆ GetWaste()

CAmount wallet::SelectionResult::GetWaste ( ) const

Definition at line 392 of file coinselection.cpp.

◆ operator<()

bool wallet::SelectionResult::operator< ( SelectionResult  other) const

Definition at line 426 of file coinselection.cpp.

Member Data Documentation

◆ m_selected_inputs

std::set<CInputCoin> wallet::SelectionResult::m_selected_inputs
private

Set of inputs selected by the algorithm to use in the transaction.

Definition at line 207 of file coinselection.h.

◆ m_target

const CAmount wallet::SelectionResult::m_target
private

The target the algorithm selected for.

Note that this may not be equal to the recipient amount as it can include non-input fees

Definition at line 209 of file coinselection.h.

◆ m_use_effective

bool wallet::SelectionResult::m_use_effective {false}
private

Whether the input values for calculations should be the effective value (true) or normal value (false)

Definition at line 211 of file coinselection.h.

◆ m_waste

std::optional<CAmount> wallet::SelectionResult::m_waste
private

The computed waste.

Definition at line 213 of file coinselection.h.


The documentation for this struct was generated from the following files: