#include <coinselection.h>
Definition at line 323 of file coinselection.h.
◆ SelectionResult() [1/2]
◆ SelectionResult() [2/2]
wallet::SelectionResult::SelectionResult |
( |
| ) |
|
|
delete |
◆ AddInput()
void wallet::SelectionResult::AddInput |
( |
const OutputGroup & |
group | ) |
|
◆ AddInputs()
void wallet::SelectionResult::AddInputs |
( |
const std::set< std::shared_ptr< COutput >> & |
inputs, |
|
|
bool |
subtract_fee_outputs |
|
) |
| |
◆ Clear()
void wallet::SelectionResult::Clear |
( |
| ) |
|
◆ ComputeAndSetWaste()
void wallet::SelectionResult::ComputeAndSetWaste |
( |
const CAmount |
min_viable_change, |
|
|
const CAmount |
change_cost, |
|
|
const CAmount |
change_fee |
|
) |
| |
Calculates and stores the waste for this selection via GetSelectionWaste.
Definition at line 429 of file coinselection.cpp.
◆ GetAlgo()
◆ GetChange()
CAmount wallet::SelectionResult::GetChange |
( |
const CAmount |
min_viable_change, |
|
|
const CAmount |
change_fee |
|
) |
| const |
Get the amount for the change output after paying needed fees.
The change amount is not 100% precise due to discrepancies in fee calculation. The final change amount (if any) should be corrected after calculating the final tx fees. When there is a discrepancy, most of the time the final change would be slightly bigger than estimated.
Following are the possible factors of discrepancy:
- non-input fees always include segwit flags
- input fee estimation always include segwit stack size
- input fees are rounded individually and not collectively, which leads to small rounding errors
- input counter size is always assumed to be 1vbyte
- Parameters
-
[in] | min_viable_change | Minimum amount for change output, if change would be less then we forgo change |
[in] | change_fee | Fees to include change output in the tx |
- Returns
- Amount for change output, 0 when there is no change.
Definition at line 534 of file coinselection.cpp.
◆ GetInputSet()
const std::set< std::shared_ptr< COutput > > & wallet::SelectionResult::GetInputSet |
( |
| ) |
const |
◆ GetSelectedEffectiveValue()
CAmount wallet::SelectionResult::GetSelectedEffectiveValue |
( |
| ) |
const |
◆ GetSelectedValue()
CAmount wallet::SelectionResult::GetSelectedValue |
( |
| ) |
const |
◆ GetShuffledInputVector()
std::vector< std::shared_ptr< COutput > > wallet::SelectionResult::GetShuffledInputVector |
( |
| ) |
const |
◆ GetTarget()
CAmount wallet::SelectionResult::GetTarget |
( |
| ) |
const |
|
inline |
◆ GetWaste()
CAmount wallet::SelectionResult::GetWaste |
( |
| ) |
const |
◆ GetWeight()
int wallet::SelectionResult::GetWeight |
( |
| ) |
const |
|
inline |
◆ InsertInputs()
template<typename T >
void wallet::SelectionResult::InsertInputs |
( |
const T & |
inputs | ) |
|
|
inlineprivate |
◆ Merge()
Combines the.
- Parameters
-
[in] | other | selection result into 'this' selection result. |
Important note: There must be no shared 'COutput' among the two selection results being combined.
Definition at line 482 of file coinselection.cpp.
◆ operator<()
◆ m_algo
The algorithm used to produce this result.
Definition at line 331 of file coinselection.h.
◆ m_selected_inputs
std::set<std::shared_ptr<COutput> > wallet::SelectionResult::m_selected_inputs |
|
private |
Set of inputs selected by the algorithm to use in the transaction.
Definition at line 327 of file coinselection.h.
◆ m_target
CAmount wallet::SelectionResult::m_target |
|
private |
The target the algorithm selected for.
Equal to the recipient amount plus non-input fees
Definition at line 329 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 333 of file coinselection.h.
◆ m_waste
std::optional<CAmount> wallet::SelectionResult::m_waste |
|
private |
◆ m_weight
int wallet::SelectionResult::m_weight {0} |
|
private |
The documentation for this struct was generated from the following files: