Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
Coin Class Reference

A UTXO entry. More...

#include <coins.h>

Collaboration diagram for Coin:
[legend]

Public Member Functions

 Coin (CTxOut &&outIn, int nHeightIn, bool fCoinBaseIn)
 construct a Coin from a CTxOut and height/coinbase information. More...
 
 Coin (const CTxOut &outIn, int nHeightIn, bool fCoinBaseIn)
 
void Clear ()
 
 Coin ()
 empty constructor More...
 
bool IsCoinBase () const
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 
bool IsSpent () const
 Either this coin never existed (see e.g. More...
 
size_t DynamicMemoryUsage () const
 

Public Attributes

CTxOut out
 unspent transaction output More...
 
unsigned int fCoinBase: 1
 whether containing transaction was a coinbase More...
 
uint32_t nHeight: 31
 at which height this containing transaction was included in the active block chain More...
 

Detailed Description

A UTXO entry.

Serialized format:

Definition at line 31 of file coins.h.

Constructor & Destructor Documentation

◆ Coin() [1/3]

Coin::Coin ( CTxOut &&  outIn,
int  nHeightIn,
bool  fCoinBaseIn 
)
inline

construct a Coin from a CTxOut and height/coinbase information.

Definition at line 44 of file coins.h.

◆ Coin() [2/3]

Coin::Coin ( const CTxOut outIn,
int  nHeightIn,
bool  fCoinBaseIn 
)
inline

Definition at line 45 of file coins.h.

◆ Coin() [3/3]

Coin::Coin ( )
inline

empty constructor

Definition at line 54 of file coins.h.

Member Function Documentation

◆ Clear()

void Coin::Clear ( )
inline

Definition at line 47 of file coins.h.

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

◆ DynamicMemoryUsage()

size_t Coin::DynamicMemoryUsage ( ) const
inline

Definition at line 84 of file coins.h.

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

◆ IsCoinBase()

bool Coin::IsCoinBase ( ) const
inline

Definition at line 56 of file coins.h.

Here is the caller graph for this function:

◆ IsSpent()

bool Coin::IsSpent ( ) const
inline

Either this coin never existed (see e.g.

coinEmpty in coins.cpp), or it did exist and has been spent.

Definition at line 80 of file coins.h.

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

◆ Serialize()

template<typename Stream >
void Coin::Serialize ( Stream &  s) const
inline

Definition at line 61 of file coins.h.

Here is the call graph for this function:

◆ Unserialize()

template<typename Stream >
void Coin::Unserialize ( Stream &  s)
inline

Definition at line 69 of file coins.h.

Member Data Documentation

◆ fCoinBase

unsigned int Coin::fCoinBase

whether containing transaction was a coinbase

Definition at line 38 of file coins.h.

◆ nHeight

uint32_t Coin::nHeight

at which height this containing transaction was included in the active block chain

Definition at line 41 of file coins.h.

◆ out

CTxOut Coin::out

unspent transaction output

Definition at line 35 of file coins.h.


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