Bitcoin Core  24.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
 
CAmount GetFee () const
 
CAmount GetEffectiveValue () 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...
 

Private Attributes

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

Detailed Description

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

Definition at line 22 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 69 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 86 of file coinselection.h.

Here is the call graph for this function:

Member Function Documentation

◆ GetEffectiveValue()

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

Definition at line 108 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 102 of file coinselection.h.

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

◆ operator<()

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

Definition at line 97 of file coinselection.h.

◆ ToString()

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

Definition at line 477 of file coinselection.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ 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 42 of file coinselection.h.

◆ effective_value

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

The output's value minus fees required to spend it.

Definition at line 25 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.

Definition at line 28 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 64 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 45 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 67 of file coinselection.h.

◆ outpoint

COutPoint wallet::COutput::outpoint

The outpoint identifying this UTXO.

Definition at line 32 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 58 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 51 of file coinselection.h.

◆ spendable

bool wallet::COutput::spendable

Whether we have the private keys to spend this output.

Definition at line 48 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 61 of file coinselection.h.

◆ txout

CTxOut wallet::COutput::txout

The output itself.

Definition at line 35 of file coinselection.h.


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