Bitcoin Core 28.99.0
P2P Digital Currency
|
Parameters for one iteration of Coin Selection. More...
#include <coinselection.h>
Public Member Functions | |
CoinSelectionParams (FastRandomContext &rng_fast, int change_output_size, int change_spend_size, CAmount min_change_target, CFeeRate effective_feerate, CFeeRate long_term_feerate, CFeeRate discard_feerate, int tx_noinputs_size, bool avoid_partial, std::optional< int > max_tx_weight=std::nullopt) | |
CoinSelectionParams (FastRandomContext &rng_fast) | |
Public Attributes | |
FastRandomContext & | rng_fast |
Randomness to use in the context of coin selection. More... | |
int | change_output_size = 0 |
Size of a change output in bytes, determined by the output type. More... | |
int | change_spend_size = 0 |
Size of the input to spend a change output in virtual bytes. More... | |
CAmount | m_min_change_target {0} |
Mininmum change to target in Knapsack solver and CoinGrinder: select coins to cover the payment and at least this value of change. More... | |
CAmount | min_viable_change {0} |
Minimum amount for creating a change output. 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... | |
int | 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... | |
bool | m_include_unsafe_inputs = false |
When true, allow unsafe coins to be selected during Coin Selection. More... | |
std::optional< int > | m_max_tx_weight {std::nullopt} |
The maximum weight for this transaction. More... | |
Parameters for one iteration of Coin Selection.
Definition at line 138 of file coinselection.h.
|
inline |
Definition at line 180 of file coinselection.h.
|
inline |
Definition at line 196 of file coinselection.h.
int wallet::CoinSelectionParams::change_output_size = 0 |
Size of a change output in bytes, determined by the output type.
Definition at line 142 of file coinselection.h.
int wallet::CoinSelectionParams::change_spend_size = 0 |
Size of the input to spend a change output in virtual bytes.
Definition at line 144 of file coinselection.h.
bool wallet::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 171 of file coinselection.h.
CAmount wallet::CoinSelectionParams::m_change_fee {0} |
Cost of creating the change output.
Definition at line 153 of file coinselection.h.
CAmount wallet::CoinSelectionParams::m_cost_of_change {0} |
Cost of creating the change output + cost of spending the change output in the future.
Definition at line 155 of file coinselection.h.
CFeeRate wallet::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 162 of file coinselection.h.
CFeeRate wallet::CoinSelectionParams::m_effective_feerate |
The targeted feerate of the transaction being built.
Definition at line 157 of file coinselection.h.
bool wallet::CoinSelectionParams::m_include_unsafe_inputs = false |
When true, allow unsafe coins to be selected during Coin Selection.
This may spend unconfirmed outputs: 1) Received from other wallets, 2) replacing other txs, 3) that have been replaced.
Definition at line 176 of file coinselection.h.
CFeeRate wallet::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 160 of file coinselection.h.
std::optional<int> wallet::CoinSelectionParams::m_max_tx_weight {std::nullopt} |
The maximum weight for this transaction.
Definition at line 178 of file coinselection.h.
CAmount wallet::CoinSelectionParams::m_min_change_target {0} |
Mininmum change to target in Knapsack solver and CoinGrinder: select coins to cover the payment and at least this value of change.
Definition at line 147 of file coinselection.h.
bool wallet::CoinSelectionParams::m_subtract_fee_outputs = false |
Indicate that we are subtracting the fee from outputs.
Definition at line 167 of file coinselection.h.
CAmount wallet::CoinSelectionParams::min_viable_change {0} |
Minimum amount for creating a change output.
If change budget is smaller than min_change then we forgo creation of change output.
Definition at line 151 of file coinselection.h.
FastRandomContext& wallet::CoinSelectionParams::rng_fast |
Randomness to use in the context of coin selection.
Definition at line 140 of file coinselection.h.
int wallet::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 165 of file coinselection.h.