Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
OutputGroup Struct Reference

A group of UTXOs paid to the same output script. More...

#include <coinselection.h>

Collaboration diagram for OutputGroup:
[legend]

Public Member Functions

 OutputGroup ()
 
 OutputGroup (const CoinSelectionParams &params)
 
void Insert (const CInputCoin &output, int depth, bool from_me, size_t ancestors, size_t descendants, bool positive_only)
 
bool EligibleForSpending (const CoinEligibilityFilter &eligibility_filter) const
 
CAmount GetSelectionAmount () const
 

Public Attributes

std::vector< CInputCoinm_outputs
 The list of UTXOs contained in this output group. More...
 
bool m_from_me {true}
 Whether the UTXOs were sent by the wallet to itself. More...
 
CAmount m_value {0}
 The total value of the UTXOs in sum. More...
 
int m_depth {999}
 The minimum number of confirmations the UTXOs in the group have. More...
 
size_t m_ancestors {0}
 The aggregated count of unconfirmed ancestors of all UTXOs in this group. More...
 
size_t m_descendants {0}
 The maximum count of descendants of a single UTXO in this output group. More...
 
CAmount effective_value {0}
 The value of the UTXOs after deducting the cost of spending them at the effective feerate. More...
 
CAmount fee {0}
 The fee to spend these UTXOs at the effective feerate. More...
 
CFeeRate m_effective_feerate {0}
 The target feerate of the transaction we're trying to build. More...
 
CAmount long_term_fee {0}
 The fee to spend these UTXOs at the long term feerate. More...
 
CFeeRate m_long_term_feerate {0}
 The feerate for spending a created change output eventually (i.e. More...
 
bool m_subtract_fee_outputs {false}
 Indicate that we are subtracting the fee from outputs. More...
 

Detailed Description

A group of UTXOs paid to the same output script.

Definition at line 138 of file coinselection.h.

Constructor & Destructor Documentation

◆ OutputGroup() [1/2]

OutputGroup::OutputGroup ( )
inline

Definition at line 171 of file coinselection.h.

◆ OutputGroup() [2/2]

OutputGroup::OutputGroup ( const CoinSelectionParams params)
inline

Definition at line 172 of file coinselection.h.

Member Function Documentation

◆ EligibleForSpending()

bool OutputGroup::EligibleForSpending ( const CoinEligibilityFilter eligibility_filter) const

Definition at line 347 of file coinselection.cpp.

Here is the caller graph for this function:

◆ GetSelectionAmount()

CAmount OutputGroup::GetSelectionAmount ( ) const

Definition at line 354 of file coinselection.cpp.

Here is the caller graph for this function:

◆ Insert()

void OutputGroup::Insert ( const CInputCoin output,
int  depth,
bool  from_me,
size_t  ancestors,
size_t  descendants,
bool  positive_only 
)

Definition at line 315 of file coinselection.cpp.

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

Member Data Documentation

◆ effective_value

CAmount OutputGroup::effective_value {0}

The value of the UTXOs after deducting the cost of spending them at the effective feerate.

Definition at line 156 of file coinselection.h.

◆ fee

CAmount OutputGroup::fee {0}

The fee to spend these UTXOs at the effective feerate.

Definition at line 158 of file coinselection.h.

◆ long_term_fee

CAmount OutputGroup::long_term_fee {0}

The fee to spend these UTXOs at the long term feerate.

Definition at line 162 of file coinselection.h.

◆ m_ancestors

size_t OutputGroup::m_ancestors {0}

The aggregated count of unconfirmed ancestors of all UTXOs in this group.

Not deduplicated and may overestimate when ancestors are shared.

Definition at line 152 of file coinselection.h.

◆ m_depth

int OutputGroup::m_depth {999}

The minimum number of confirmations the UTXOs in the group have.

Unconfirmed is 0.

Definition at line 149 of file coinselection.h.

◆ m_descendants

size_t OutputGroup::m_descendants {0}

The maximum count of descendants of a single UTXO in this output group.

Definition at line 154 of file coinselection.h.

◆ m_effective_feerate

CFeeRate OutputGroup::m_effective_feerate {0}

The target feerate of the transaction we're trying to build.

Definition at line 160 of file coinselection.h.

◆ m_from_me

bool OutputGroup::m_from_me {true}

Whether the UTXOs were sent by the wallet to itself.

This is relevant because we may want at least a certain number of confirmations on UTXOs received from outside wallets while trusting our own UTXOs more.

Definition at line 145 of file coinselection.h.

◆ m_long_term_feerate

CFeeRate OutputGroup::m_long_term_feerate {0}

The feerate for spending a created change output eventually (i.e.

not urgently, and thus at a lower feerate). Calculated using long term fee estimate. This is used to decide whether it could be economical to create a change output.

Definition at line 166 of file coinselection.h.

◆ m_outputs

std::vector<CInputCoin> OutputGroup::m_outputs

The list of UTXOs contained in this output group.

Definition at line 141 of file coinselection.h.

◆ m_subtract_fee_outputs

bool OutputGroup::m_subtract_fee_outputs {false}

Indicate that we are subtracting the fee from outputs.

When true, the value that is used for coin selection is the UTXO's real value rather than effective value

Definition at line 169 of file coinselection.h.

◆ m_value

CAmount OutputGroup::m_value {0}

The total value of the UTXOs in sum.

Definition at line 147 of file coinselection.h.


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