Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Private Attributes | List of all members
wallet::CCoinControl Class Reference

Coin Control Features. More...

#include <coincontrol.h>

Collaboration diagram for wallet::CCoinControl:
[legend]

Public Member Functions

 CCoinControl ()
 
bool HasSelected () const
 Returns true if there are pre-selected inputs. More...
 
bool IsSelected (const COutPoint &outpoint) const
 Returns true if the given output is pre-selected. More...
 
bool IsExternalSelected (const COutPoint &outpoint) const
 Returns true if the given output is selected as an external input. More...
 
std::optional< CTxOutGetExternalOutput (const COutPoint &outpoint) const
 Returns the external output for the given outpoint if it exists. More...
 
PreselectedInputSelect (const COutPoint &outpoint)
 Lock-in the given output for spending. More...
 
void UnSelect (const COutPoint &outpoint)
 Unselects the given output. More...
 
void UnSelectAll ()
 Unselects all outputs. More...
 
std::vector< COutPointListSelected () const
 List the selected inputs. More...
 
void SetInputWeight (const COutPoint &outpoint, int64_t weight)
 Set an input's weight. More...
 
std::optional< int64_t > GetInputWeight (const COutPoint &outpoint) const
 Returns the input weight. More...
 
std::optional< uint32_t > GetSequence (const COutPoint &outpoint) const
 Retrieve the sequence for an input. More...
 
std::pair< std::optional< CScript >, std::optional< CScriptWitness > > GetScripts (const COutPoint &outpoint) const
 Retrieves the scriptSig and scriptWitness for an input. More...
 
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. More...
 
std::optional< OutputTypem_change_type
 Override the default change type if set, ignored if destChange is set. More...
 
bool m_include_unsafe_inputs = false
 If false, only safe inputs will be used. More...
 
bool 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. More...
 
bool fAllowWatchOnly = false
 Includes watch only addresses which are solvable. More...
 
bool fOverrideFeeRate = false
 Override automatic min/max checks on fee, m_feerate must be set if true. More...
 
std::optional< CFeeRatem_feerate
 Override the wallet's m_pay_tx_fee if set. More...
 
std::optional< unsigned int > m_confirm_target
 Override the default confirmation target if set. More...
 
std::optional< bool > m_signal_bip125_rbf
 Override the wallet's m_signal_rbf if set. More...
 
bool m_avoid_partial_spends = DEFAULT_AVOIDPARTIALSPENDS
 Avoid partial use of funds sent to a given address. More...
 
bool m_avoid_address_reuse = false
 Forbids inclusion of dirty (previously used) addresses. More...
 
FeeEstimateMode m_fee_mode = FeeEstimateMode::UNSET
 Fee estimation mode to control arguments to estimateSmartFee. More...
 
int m_min_depth = DEFAULT_MIN_DEPTH
 Minimum chain depth value for coin availability. More...
 
int m_max_depth = DEFAULT_MAX_DEPTH
 Maximum chain depth value for coin availability. More...
 
FlatSigningProvider m_external_provider
 SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs. More...
 
std::optional< uint32_t > m_locktime
 Locktime. More...
 
std::optional< uint32_t > m_version
 Version. More...
 

Private Attributes

std::map< COutPoint, PreselectedInputm_selected
 Selected inputs (inputs that will be used, regardless of whether they're optimal or not) More...
 
unsigned int m_selection_pos {0}
 

Detailed Description

Coin Control Features.

Definition at line 80 of file coincontrol.h.

Constructor & Destructor Documentation

◆ CCoinControl()

wallet::CCoinControl::CCoinControl ( )

Definition at line 10 of file coincontrol.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ GetExternalOutput()

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.

Here is the caller graph for this function:

◆ GetInputWeight()

std::optional< int64_t > wallet::CCoinControl::GetInputWeight ( const COutPoint outpoint) const

Returns the input weight.

Definition at line 72 of file coincontrol.cpp.

Here is the caller graph for this function:

◆ GetScripts()

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.

◆ GetSelectionPos()

std::optional<unsigned int> wallet::CCoinControl::GetSelectionPos ( const COutPoint outpoint) const
inline

Definition at line 172 of file coincontrol.h.

◆ GetSequence()

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.

◆ HasSelected()

bool wallet::CCoinControl::HasSelected ( ) const

Returns true if there are pre-selected inputs.

Definition at line 15 of file coincontrol.cpp.

Here is the caller graph for this function:

◆ HasSelectedOrder()

bool wallet::CCoinControl::HasSelectedOrder ( ) const
inline

Definition at line 167 of file coincontrol.h.

◆ IsExternalSelected()

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.

Here is the caller graph for this function:

◆ IsSelected()

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.

Here is the caller graph for this function:

◆ ListSelected()

std::vector< COutPoint > wallet::CCoinControl::ListSelected ( ) const

List the selected inputs.

Definition at line 57 of file coincontrol.cpp.

Here is the caller graph for this function:

◆ Select()

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.

Here is the caller graph for this function:

◆ SetInputWeight()

void wallet::CCoinControl::SetInputWeight ( const COutPoint outpoint,
int64_t  weight 
)

Set an input's weight.

Definition at line 67 of file coincontrol.cpp.

Here is the caller graph for this function:

◆ UnSelect()

void wallet::CCoinControl::UnSelect ( const COutPoint outpoint)

Unselects the given output.

Definition at line 47 of file coincontrol.cpp.

Here is the caller graph for this function:

◆ UnSelectAll()

void wallet::CCoinControl::UnSelectAll ( )

Unselects all outputs.

Definition at line 52 of file coincontrol.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ destChange

CTxDestination wallet::CCoinControl::destChange = CNoDestination()

Custom change destination, if not set an address is generated.

Definition at line 84 of file coincontrol.h.

◆ fAllowWatchOnly

bool wallet::CCoinControl::fAllowWatchOnly = false

Includes watch only addresses which are solvable.

Definition at line 93 of file coincontrol.h.

◆ fOverrideFeeRate

bool wallet::CCoinControl::fOverrideFeeRate = false

Override automatic min/max checks on fee, m_feerate must be set if true.

Definition at line 95 of file coincontrol.h.

◆ m_allow_other_inputs

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 91 of file coincontrol.h.

◆ m_avoid_address_reuse

bool wallet::CCoinControl::m_avoid_address_reuse = false

Forbids inclusion of dirty (previously used) addresses.

Definition at line 105 of file coincontrol.h.

◆ m_avoid_partial_spends

bool wallet::CCoinControl::m_avoid_partial_spends = DEFAULT_AVOIDPARTIALSPENDS

Avoid partial use of funds sent to a given address.

Definition at line 103 of file coincontrol.h.

◆ m_change_type

std::optional<OutputType> wallet::CCoinControl::m_change_type

Override the default change type if set, ignored if destChange is set.

Definition at line 86 of file coincontrol.h.

◆ m_confirm_target

std::optional<unsigned int> wallet::CCoinControl::m_confirm_target

Override the default confirmation target if set.

Definition at line 99 of file coincontrol.h.

◆ m_external_provider

FlatSigningProvider wallet::CCoinControl::m_external_provider

SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs.

Definition at line 113 of file coincontrol.h.

◆ m_fee_mode

FeeEstimateMode wallet::CCoinControl::m_fee_mode = FeeEstimateMode::UNSET

Fee estimation mode to control arguments to estimateSmartFee.

Definition at line 107 of file coincontrol.h.

◆ m_feerate

std::optional<CFeeRate> wallet::CCoinControl::m_feerate

Override the wallet's m_pay_tx_fee if set.

Definition at line 97 of file coincontrol.h.

◆ m_include_unsafe_inputs

bool wallet::CCoinControl::m_include_unsafe_inputs = false

If false, only safe inputs will be used.

Definition at line 88 of file coincontrol.h.

◆ m_locktime

std::optional<uint32_t> wallet::CCoinControl::m_locktime

Locktime.

Definition at line 115 of file coincontrol.h.

◆ m_max_depth

int wallet::CCoinControl::m_max_depth = DEFAULT_MAX_DEPTH

Maximum chain depth value for coin availability.

Definition at line 111 of file coincontrol.h.

◆ m_min_depth

int wallet::CCoinControl::m_min_depth = DEFAULT_MIN_DEPTH

Minimum chain depth value for coin availability.

Definition at line 109 of file coincontrol.h.

◆ m_selected

std::map<COutPoint, PreselectedInput> wallet::CCoinControl::m_selected
private

Selected inputs (inputs that will be used, regardless of whether they're optimal or not)

Definition at line 183 of file coincontrol.h.

◆ m_selection_pos

unsigned int wallet::CCoinControl::m_selection_pos {0}
private

Definition at line 184 of file coincontrol.h.

◆ m_signal_bip125_rbf

std::optional<bool> wallet::CCoinControl::m_signal_bip125_rbf

Override the wallet's m_signal_rbf if set.

Definition at line 101 of file coincontrol.h.

◆ m_version

std::optional<uint32_t> wallet::CCoinControl::m_version

Version.

Definition at line 117 of file coincontrol.h.


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