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

Parameters for one iteration of Coin Selection. More...

#include <coinselection.h>

Collaboration diagram for CoinSelectionParams:
[legend]

Public Member Functions

 CoinSelectionParams (size_t change_output_size, size_t change_spend_size, CFeeRate effective_feerate, CFeeRate long_term_feerate, CFeeRate discard_feerate, size_t tx_noinputs_size, bool avoid_partial)
 
 CoinSelectionParams ()
 

Public Attributes

size_t change_output_size = 0
 Size of a change output in bytes, determined by the output type. More...
 
size_t change_spend_size = 0
 Size of the input to spend a change output in virtual bytes. More...
 
CAmount m_change_fee {0}
 Cost of creating the change output. More...
 
CAmount m_cost_of_change {0}
 Cost of creating the change output + cost of spending the change output in the future. More...
 
CFeeRate m_effective_feerate
 The targeted feerate of the transaction being built. More...
 
CFeeRate m_long_term_feerate
 The feerate estimate used to estimate an upper bound on what should be sufficient to spend the change output sometime in the future. More...
 
CFeeRate m_discard_feerate
 If the cost to spend a change output at the discard feerate exceeds its value, drop it to fees. More...
 
size_t tx_noinputs_size = 0
 Size of the transaction before coin selection, consisting of the header and recipient output(s), excluding the inputs and change output(s). More...
 
bool m_subtract_fee_outputs = false
 Indicate that we are subtracting the fee from outputs. More...
 
bool m_avoid_partial_spends = false
 When true, always spend all (up to OUTPUT_GROUP_MAX_ENTRIES) or none of the outputs associated with the same address. More...
 

Detailed Description

Parameters for one iteration of Coin Selection.

Definition at line 61 of file coinselection.h.

Constructor & Destructor Documentation

◆ CoinSelectionParams() [1/2]

CoinSelectionParams::CoinSelectionParams ( size_t  change_output_size,
size_t  change_spend_size,
CFeeRate  effective_feerate,
CFeeRate  long_term_feerate,
CFeeRate  discard_feerate,
size_t  tx_noinputs_size,
bool  avoid_partial 
)
inline

Definition at line 88 of file coinselection.h.

◆ CoinSelectionParams() [2/2]

CoinSelectionParams::CoinSelectionParams ( )
inline

Definition at line 98 of file coinselection.h.

Member Data Documentation

◆ change_output_size

size_t CoinSelectionParams::change_output_size = 0

Size of a change output in bytes, determined by the output type.

Definition at line 64 of file coinselection.h.

◆ change_spend_size

size_t CoinSelectionParams::change_spend_size = 0

Size of the input to spend a change output in virtual bytes.

Definition at line 66 of file coinselection.h.

◆ m_avoid_partial_spends

bool CoinSelectionParams::m_avoid_partial_spends = false

When true, always spend all (up to OUTPUT_GROUP_MAX_ENTRIES) or none of the outputs associated with the same address.

This helps reduce privacy leaks resulting from address reuse. Dust outputs are not eligible to be added to output groups and thus not considered.

Definition at line 86 of file coinselection.h.

◆ m_change_fee

CAmount CoinSelectionParams::m_change_fee {0}

Cost of creating the change output.

Definition at line 68 of file coinselection.h.

◆ m_cost_of_change

CAmount CoinSelectionParams::m_cost_of_change {0}

Cost of creating the change output + cost of spending the change output in the future.

Definition at line 70 of file coinselection.h.

◆ m_discard_feerate

CFeeRate CoinSelectionParams::m_discard_feerate

If the cost to spend a change output at the discard feerate exceeds its value, drop it to fees.

Definition at line 77 of file coinselection.h.

◆ m_effective_feerate

CFeeRate CoinSelectionParams::m_effective_feerate

The targeted feerate of the transaction being built.

Definition at line 72 of file coinselection.h.

◆ m_long_term_feerate

CFeeRate CoinSelectionParams::m_long_term_feerate

The feerate estimate used to estimate an upper bound on what should be sufficient to spend the change output sometime in the future.

Definition at line 75 of file coinselection.h.

◆ m_subtract_fee_outputs

bool CoinSelectionParams::m_subtract_fee_outputs = false

Indicate that we are subtracting the fee from outputs.

Definition at line 82 of file coinselection.h.

◆ tx_noinputs_size

size_t CoinSelectionParams::tx_noinputs_size = 0

Size of the transaction before coin selection, consisting of the header and recipient output(s), excluding the inputs and change output(s).

Definition at line 80 of file coinselection.h.


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