Anoncoin  0.9.4
P2P Digital Currency
Public Member Functions | Public Attributes | Friends | List of all members
CCoins Class Reference

pruned version of CTransaction: only retains metadata and unspent transaction outputs More...

#include <coins.h>

Public Member Functions

 CCoins (const CTransaction &tx, int nHeightIn)
 
 CCoins ()
 
void Cleanup ()
 
void swap (CCoins &to)
 
void CalcMaskSize (unsigned int &nBytes, unsigned int &nNonzeroBytes) const
 
bool IsCoinBase () const
 
unsigned int GetSerializeSize (int nType, int nVersion) const
 
template<typename Stream >
void Serialize (Stream &s, int nType, int nVersion) const
 
template<typename Stream >
void Unserialize (Stream &s, int nType, int nVersion)
 
bool Spend (const COutPoint &out, CTxInUndo &undo)
 
bool Spend (int nPos)
 
bool IsAvailable (unsigned int nPos) const
 
bool IsPruned () const
 

Public Attributes

bool fCoinBase
 
std::vector< CTxOutvout
 
int nHeight
 
int nVersion
 

Friends

bool operator== (const CCoins &a, const CCoins &b)
 
bool operator!= (const CCoins &a, const CCoins &b)
 

Detailed Description

pruned version of CTransaction: only retains metadata and unspent transaction outputs

Serialized format:

The nCode value consists of:

Example: 0104835800816115944e077fe7c803cfa57f29b36bf87c1d358bb85e <><><-----------------------------------------—><-—> | \ | / version code vout[1] height

Example: 0109044086ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4eebbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa486af3b <><><–><-----------------------------------------------—><-------------------------------------------—><-—> / \ \ | | / version code unspentness vout[4] vout[16] height

Definition at line 69 of file coins.h.

Constructor & Destructor Documentation

CCoins::CCoins ( const CTransaction tx,
int  nHeightIn 
)
inline

Definition at line 86 of file coins.h.

CCoins::CCoins ( )
inline

Definition at line 91 of file coins.h.

Member Function Documentation

void CCoins::CalcMaskSize ( unsigned int &  nBytes,
unsigned int &  nNonzeroBytes 
) const

Definition at line 13 of file coins.cpp.

Here is the caller graph for this function:

void CCoins::Cleanup ( )
inline

Definition at line 94 of file coins.h.

Here is the caller graph for this function:

unsigned int CCoins::GetSerializeSize ( int  nType,
int  nVersion 
) const
inline

Definition at line 136 of file coins.h.

Here is the call graph for this function:

bool CCoins::IsAvailable ( unsigned int  nPos) const
inline

Definition at line 229 of file coins.h.

Here is the caller graph for this function:

bool CCoins::IsCoinBase ( ) const
inline

Definition at line 132 of file coins.h.

Here is the caller graph for this function:

bool CCoins::IsPruned ( ) const
inline

Definition at line 235 of file coins.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename Stream >
void CCoins::Serialize ( Stream &  s,
int  nType,
int  nVersion 
) const
inline

Definition at line 160 of file coins.h.

Here is the call graph for this function:

bool CCoins::Spend ( const COutPoint out,
CTxInUndo undo 
)

Definition at line 31 of file coins.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CCoins::Spend ( int  nPos)

Definition at line 47 of file coins.cpp.

Here is the call graph for this function:

void CCoins::swap ( CCoins to)
inline

Definition at line 109 of file coins.h.

Here is the caller graph for this function:

template<typename Stream >
void CCoins::Unserialize ( Stream &  s,
int  nType,
int  nVersion 
)
inline

Definition at line 189 of file coins.h.

Here is the call graph for this function:

Friends And Related Function Documentation

bool operator!= ( const CCoins a,
const CCoins b 
)
friend

Definition at line 126 of file coins.h.

bool operator== ( const CCoins a,
const CCoins b 
)
friend

Definition at line 117 of file coins.h.

Member Data Documentation

bool CCoins::fCoinBase

Definition at line 73 of file coins.h.

int CCoins::nHeight

Definition at line 79 of file coins.h.

int CCoins::nVersion

Definition at line 83 of file coins.h.

std::vector<CTxOut> CCoins::vout

Definition at line 76 of file coins.h.


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