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

A UTXO under consideration for use in funding a new transaction. More...

#include <coinselection.h>

Collaboration diagram for wallet::COutput:
[legend]

Public Member Functions

 COutput (const COutPoint &outpoint, const CTxOut &txout, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me, const std::optional< CFeeRate > feerate=std::nullopt)
 
 COutput (const COutPoint &outpoint, const CTxOut &txout, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me, const CAmount fees)
 
std::string ToString () const
 
bool operator< (const COutput &rhs) const
 
void ApplyBumpFee (CAmount bump_fee)
 
CAmount GetFee () const
 
CAmount GetEffectiveValue () const
 
bool HasEffectiveValue () const
 

Public Attributes

COutPoint outpoint
 The outpoint identifying this UTXO. More...
 
CTxOut txout
 The output itself. More...
 
int depth
 Depth in block chain. More...
 
int input_bytes
 Pre-computed estimated size of this output as a fully-signed input in a transaction. More...
 
bool spendable
 Whether we have the private keys to spend this output. More...
 
bool solvable
 Whether we know how to spend this output, ignoring the lack of keys. More...
 
bool safe
 Whether this output is considered safe to spend. More...
 
int64_t time
 The time of the transaction containing this output as determined by CWalletTx::nTimeSmart. More...
 
bool from_me
 Whether the transaction containing this output is sent from the owning wallet. More...
 
CAmount long_term_fee {0}
 The fee required to spend this output at the consolidation feerate. More...
 
CAmount ancestor_bump_fees {0}
 The fee necessary to bump this UTXO's ancestor transactions to the target feerate. More...
 

Private Attributes

std::optional< CAmounteffective_value
 The output's value minus fees required to spend it and bump its unconfirmed ancestors to the target feerate. More...
 
std::optional< CAmountfee
 The fee required to spend this output at the transaction's target feerate and to bump its unconfirmed ancestors to the target feerate. More...
 

Detailed Description

A UTXO under consideration for use in funding a new transaction.

Definition at line 28 of file coinselection.h.

Constructor & Destructor Documentation

◆ COutput() [1/2]

wallet::COutput::COutput ( const COutPoint outpoint,
const CTxOut txout,
int  depth,
int  input_bytes,
bool  spendable,
bool  solvable,
bool  safe,
int64_t  time,
bool  from_me,
const std::optional< CFeeRate feerate = std::nullopt 
)
inline

Definition at line 78 of file coinselection.h.

◆ COutput() [2/2]

wallet::COutput::COutput ( const COutPoint outpoint,
const CTxOut txout,
int  depth,
int  input_bytes,
bool  spendable,
bool  solvable,
bool  safe,
int64_t  time,
bool  from_me,
const CAmount  fees 
)
inline

Definition at line 96 of file coinselection.h.

Here is the call graph for this function:

Member Function Documentation

◆ ApplyBumpFee()

void wallet::COutput::ApplyBumpFee ( CAmount  bump_fee)
inline

Definition at line 112 of file coinselection.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEffectiveValue()

CAmount wallet::COutput::GetEffectiveValue ( ) const
inline

Definition at line 128 of file coinselection.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFee()

CAmount wallet::COutput::GetFee ( ) const
inline

Definition at line 122 of file coinselection.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasEffectiveValue()

bool wallet::COutput::HasEffectiveValue ( ) const
inline

Definition at line 134 of file coinselection.h.

◆ operator<()

bool wallet::COutput::operator< ( const COutput rhs) const
inline

Definition at line 107 of file coinselection.h.

◆ ToString()

std::string wallet::COutput::ToString ( ) const

Definition at line 955 of file coinselection.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ ancestor_bump_fees

CAmount wallet::COutput::ancestor_bump_fees {0}

The fee necessary to bump this UTXO's ancestor transactions to the target feerate.

Definition at line 76 of file coinselection.h.

◆ depth

int wallet::COutput::depth

Depth in block chain.

If > 0: the tx is on chain and has this many confirmations. If = 0: the tx is waiting confirmation. If < 0: a conflicting tx is on chain and has this many confirmations.

Definition at line 48 of file coinselection.h.

◆ effective_value

std::optional<CAmount> wallet::COutput::effective_value
private

The output's value minus fees required to spend it and bump its unconfirmed ancestors to the target feerate.

Definition at line 31 of file coinselection.h.

◆ fee

std::optional<CAmount> wallet::COutput::fee
private

The fee required to spend this output at the transaction's target feerate and to bump its unconfirmed ancestors to the target feerate.

Definition at line 34 of file coinselection.h.

◆ from_me

bool wallet::COutput::from_me

Whether the transaction containing this output is sent from the owning wallet.

Definition at line 70 of file coinselection.h.

◆ input_bytes

int wallet::COutput::input_bytes

Pre-computed estimated size of this output as a fully-signed input in a transaction.

Can be -1 if it could not be calculated

Definition at line 51 of file coinselection.h.

◆ long_term_fee

CAmount wallet::COutput::long_term_fee {0}

The fee required to spend this output at the consolidation feerate.

Definition at line 73 of file coinselection.h.

◆ outpoint

COutPoint wallet::COutput::outpoint

The outpoint identifying this UTXO.

Definition at line 38 of file coinselection.h.

◆ safe

bool wallet::COutput::safe

Whether this output is considered safe to spend.

Unconfirmed transactions from outside keys and unconfirmed replacement transactions are considered unsafe and will not be used to fund new spending transactions.

Definition at line 64 of file coinselection.h.

◆ solvable

bool wallet::COutput::solvable

Whether we know how to spend this output, ignoring the lack of keys.

Definition at line 57 of file coinselection.h.

◆ spendable

bool wallet::COutput::spendable

Whether we have the private keys to spend this output.

Definition at line 54 of file coinselection.h.

◆ time

int64_t wallet::COutput::time

The time of the transaction containing this output as determined by CWalletTx::nTimeSmart.

Definition at line 67 of file coinselection.h.

◆ txout

CTxOut wallet::COutput::txout

The output itself.

Definition at line 41 of file coinselection.h.


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