![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
Coin Control Features. More...
#include <coincontrol.h>
Public Member Functions | |
| CCoinControl () | |
| bool | HasSelected () const |
| Returns true if there are pre-selected inputs. | |
| bool | IsSelected (const COutPoint &outpoint) const |
| Returns true if the given output is pre-selected. | |
| bool | IsExternalSelected (const COutPoint &outpoint) const |
| Returns true if the given output is selected as an external input. | |
| std::optional< CTxOut > | GetExternalOutput (const COutPoint &outpoint) const |
| Returns the external output for the given outpoint if it exists. | |
| PreselectedInput & | Select (const COutPoint &outpoint) |
| Lock-in the given output for spending. | |
| void | UnSelect (const COutPoint &outpoint) |
| Unselects the given output. | |
| void | UnSelectAll () |
| Unselects all outputs. | |
| std::vector< COutPoint > | ListSelected () const |
| List the selected inputs. | |
| void | SetInputWeight (const COutPoint &outpoint, int64_t weight) |
| Set an input's weight. | |
| std::optional< int64_t > | GetInputWeight (const COutPoint &outpoint) const |
| Returns the input weight. | |
| std::optional< uint32_t > | GetSequence (const COutPoint &outpoint) const |
| Retrieve the sequence for an input. | |
| std::pair< std::optional< CScript >, std::optional< CScriptWitness > > | GetScripts (const COutPoint &outpoint) const |
| Retrieves the scriptSig and scriptWitness for an input. | |
| bool | HasSelectedOrder () const |
| std::optional< unsigned int > | GetSelectionPos (const COutPoint &outpoint) const |
Public Attributes | |
| CTxDestination | destChange = CNoDestination() |
| Custom change destination, if not set an address is generated. | |
| std::optional< OutputType > | m_change_type |
| Override the default change type if set, ignored if destChange is set. | |
| bool | m_include_unsafe_inputs = false |
| If false, only safe inputs will be used. | |
| bool | m_allow_other_inputs = true |
| bool | fOverrideFeeRate = false |
| Override automatic min/max checks on fee, m_feerate must be set if true. | |
| std::optional< CFeeRate > | m_feerate |
| Override the wallet's fee rate if set. | |
| std::optional< unsigned int > | m_confirm_target |
| Override the default confirmation target if set. | |
| std::optional< bool > | m_signal_bip125_rbf |
| Override the wallet's m_signal_rbf if set. | |
| bool | m_avoid_partial_spends = DEFAULT_AVOIDPARTIALSPENDS |
| Avoid partial use of funds sent to a given address. | |
| bool | m_avoid_address_reuse = false |
| Forbids inclusion of dirty (previously used) addresses. | |
| FeeEstimateMode | m_fee_mode = FeeEstimateMode::UNSET |
| Fee estimation mode to control arguments to estimateSmartFee. | |
| int | m_min_depth = DEFAULT_MIN_DEPTH |
| Minimum chain depth value for coin availability. | |
| int | m_max_depth = DEFAULT_MAX_DEPTH |
| Maximum chain depth value for coin availability. | |
| FlatSigningProvider | m_external_provider |
| SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs. | |
| uint32_t | m_version = DEFAULT_WALLET_TX_VERSION |
| Version. | |
| std::optional< uint32_t > | m_locktime |
| Locktime. | |
| std::optional< int > | m_max_tx_weight {std::nullopt} |
| Caps weight of resulting tx. | |
Private Attributes | |
| std::map< COutPoint, PreselectedInput > | m_selected |
| Selected inputs (inputs that will be used, regardless of whether they're optimal or not). | |
| unsigned int | m_selection_pos {0} |
Coin Control Features.
Definition at line 83 of file coincontrol.h.
Definition at line 10 of file coincontrol.cpp.
| std::optional< CTxOut > wallet::CCoinControl::GetExternalOutput | ( | const COutPoint & | outpoint | ) | const |
Returns the external output for the given outpoint if it exists.
Definition at line 31 of file coincontrol.cpp.
| std::optional< int64_t > wallet::CCoinControl::GetInputWeight | ( | const COutPoint & | outpoint | ) | const |
Returns the input weight.
Definition at line 72 of file coincontrol.cpp.
| std::pair< std::optional< CScript >, std::optional< CScriptWitness > > wallet::CCoinControl::GetScripts | ( | const COutPoint & | outpoint | ) | const |
Retrieves the scriptSig and scriptWitness for an input.
Definition at line 84 of file coincontrol.cpp.
|
inline |
Definition at line 175 of file coincontrol.h.
| std::optional< uint32_t > wallet::CCoinControl::GetSequence | ( | const COutPoint & | outpoint | ) | const |
Retrieve the sequence for an input.
Definition at line 78 of file coincontrol.cpp.
| bool wallet::CCoinControl::HasSelected | ( | ) | const |
Returns true if there are pre-selected inputs.
Definition at line 15 of file coincontrol.cpp.
|
inline |
Definition at line 170 of file coincontrol.h.
| bool wallet::CCoinControl::IsExternalSelected | ( | const COutPoint & | outpoint | ) | const |
Returns true if the given output is selected as an external input.
Definition at line 25 of file coincontrol.cpp.
| bool wallet::CCoinControl::IsSelected | ( | const COutPoint & | outpoint | ) | const |
Returns true if the given output is pre-selected.
Definition at line 20 of file coincontrol.cpp.
| std::vector< COutPoint > wallet::CCoinControl::ListSelected | ( | ) | const |
List the selected inputs.
Definition at line 57 of file coincontrol.cpp.
| PreselectedInput & wallet::CCoinControl::Select | ( | const COutPoint & | outpoint | ) |
Lock-in the given output for spending.
The output will be included in the transaction even if it's not the most optimal choice.
Definition at line 40 of file coincontrol.cpp.
| void wallet::CCoinControl::SetInputWeight | ( | const COutPoint & | outpoint, |
| int64_t | weight ) |
Set an input's weight.
Definition at line 67 of file coincontrol.cpp.
| void wallet::CCoinControl::UnSelect | ( | const COutPoint & | outpoint | ) |
Unselects the given output.
Definition at line 47 of file coincontrol.cpp.
| void wallet::CCoinControl::UnSelectAll | ( | ) |
Unselects all outputs.
Definition at line 52 of file coincontrol.cpp.
Custom change destination, if not set an address is generated.
Definition at line 87 of file coincontrol.h.
| bool wallet::CCoinControl::fOverrideFeeRate = false |
Override automatic min/max checks on fee, m_feerate must be set if true.
Definition at line 96 of file coincontrol.h.
| bool wallet::CCoinControl::m_allow_other_inputs = true |
If true, the selection process can add extra unselected inputs from the wallet while requires all selected inputs be used
Definition at line 94 of file coincontrol.h.
| bool wallet::CCoinControl::m_avoid_address_reuse = false |
Forbids inclusion of dirty (previously used) addresses.
Definition at line 106 of file coincontrol.h.
| bool wallet::CCoinControl::m_avoid_partial_spends = DEFAULT_AVOIDPARTIALSPENDS |
Avoid partial use of funds sent to a given address.
Definition at line 104 of file coincontrol.h.
| std::optional<OutputType> wallet::CCoinControl::m_change_type |
Override the default change type if set, ignored if destChange is set.
Definition at line 89 of file coincontrol.h.
| std::optional<unsigned int> wallet::CCoinControl::m_confirm_target |
Override the default confirmation target if set.
Definition at line 100 of file coincontrol.h.
SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs.
Definition at line 114 of file coincontrol.h.
Fee estimation mode to control arguments to estimateSmartFee.
Definition at line 108 of file coincontrol.h.
| std::optional<CFeeRate> wallet::CCoinControl::m_feerate |
Override the wallet's fee rate if set.
Definition at line 98 of file coincontrol.h.
| bool wallet::CCoinControl::m_include_unsafe_inputs = false |
If false, only safe inputs will be used.
Definition at line 91 of file coincontrol.h.
| std::optional<uint32_t> wallet::CCoinControl::m_locktime |
Locktime.
Definition at line 118 of file coincontrol.h.
| int wallet::CCoinControl::m_max_depth = DEFAULT_MAX_DEPTH |
Maximum chain depth value for coin availability.
Definition at line 112 of file coincontrol.h.
| std::optional<int> wallet::CCoinControl::m_max_tx_weight {std::nullopt} |
Caps weight of resulting tx.
Definition at line 120 of file coincontrol.h.
| int wallet::CCoinControl::m_min_depth = DEFAULT_MIN_DEPTH |
Minimum chain depth value for coin availability.
Definition at line 110 of file coincontrol.h.
|
private |
Selected inputs (inputs that will be used, regardless of whether they're optimal or not).
Definition at line 186 of file coincontrol.h.
|
private |
Definition at line 187 of file coincontrol.h.
| std::optional<bool> wallet::CCoinControl::m_signal_bip125_rbf |
Override the wallet's m_signal_rbf if set.
Definition at line 102 of file coincontrol.h.
| uint32_t wallet::CCoinControl::m_version = DEFAULT_WALLET_TX_VERSION |
Version.
Definition at line 116 of file coincontrol.h.