![]() |
Bitcoin Core
24.99.0
P2P Digital Currency
|
Parameters for one iteration of Coin Selection. More...
#include <coinselection.h>
Public Member Functions | |
CoinSelectionParams (FastRandomContext &rng_fast, size_t change_output_size, size_t change_spend_size, CAmount min_change_target, CFeeRate effective_feerate, CFeeRate long_term_feerate, CFeeRate discard_feerate, size_t tx_noinputs_size, bool avoid_partial) | |
CoinSelectionParams (FastRandomContext &rng_fast) | |
Public Attributes | |
FastRandomContext & | rng_fast |
Randomness to use in the context of coin selection. More... | |
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_min_change_target {0} |
Mininmum change to target in Knapsack solver: 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... | |
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... | |
bool | m_include_unsafe_inputs = false |
When true, allow unsafe coins to be selected during Coin Selection. More... | |
Parameters for one iteration of Coin Selection.
Definition at line 122 of file coinselection.h.
|
inline |
Definition at line 162 of file coinselection.h.
|
inline |
Definition at line 176 of file coinselection.h.
size_t wallet::CoinSelectionParams::change_output_size = 0 |
Size of a change output in bytes, determined by the output type.
Definition at line 126 of file coinselection.h.
size_t wallet::CoinSelectionParams::change_spend_size = 0 |
Size of the input to spend a change output in virtual bytes.
Definition at line 128 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 155 of file coinselection.h.
CAmount wallet::CoinSelectionParams::m_change_fee {0} |
Cost of creating the change output.
Definition at line 137 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 139 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 146 of file coinselection.h.
CFeeRate wallet::CoinSelectionParams::m_effective_feerate |
The targeted feerate of the transaction being built.
Definition at line 141 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 160 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 144 of file coinselection.h.
CAmount wallet::CoinSelectionParams::m_min_change_target {0} |
Mininmum change to target in Knapsack solver: select coins to cover the payment and at least this value of change.
Definition at line 131 of file coinselection.h.
bool wallet::CoinSelectionParams::m_subtract_fee_outputs = false |
Indicate that we are subtracting the fee from outputs.
Definition at line 151 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 135 of file coinselection.h.
FastRandomContext& wallet::CoinSelectionParams::rng_fast |
Randomness to use in the context of coin selection.
Definition at line 124 of file coinselection.h.
size_t 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 149 of file coinselection.h.