Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CTransaction Class Reference

The basic transaction that is broadcasted on the network and contained in blocks. More...

#include <transaction.h>

Collaboration diagram for CTransaction:
[legend]

Public Member Functions

 CTransaction ()
 Construct a CTransaction that qualifies as IsNull() More...
 
 CTransaction (const CMutableTransaction &tx)
 Convert a CMutableTransaction into a CTransaction. More...
 
 CTransaction (CMutableTransaction &&tx)
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
 CTransaction (deserialize_type, Stream &s)
 This deserializing constructor is provided instead of an Unserialize method. More...
 
bool IsNull () const
 
const uint256GetHash () const
 
uint256 GetWitnessHash () const
 
CAmount GetValueOut () const
 
unsigned int GetTotalSize () const
 Get the total transaction size in bytes, including witness data. More...
 
bool HasCreateOrCall () const
 
bool HasOpSpend () const
 
bool IsCoinBase () const
 
bool IsCoinStake () const
 
bool IsNormalTx () const
 
std::string ToString () const
 
bool HasWitness () const
 

Public Attributes

const std::vector< CTxInvin
 
const std::vector< CTxOutvout
 
const int32_t nVersion
 
const uint32_t nLockTime
 

Static Public Attributes

static const int32_t CURRENT_VERSION =2
 
static const int32_t MAX_STANDARD_VERSION =2
 

Private Member Functions

uint256 ComputeHash () const
 

Private Attributes

const uint256 hash
 Memory only. More...
 

Friends

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

Detailed Description

The basic transaction that is broadcasted on the network and contained in blocks.

A transaction can contain multiple inputs and outputs.

Definition at line 275 of file transaction.h.

Constructor & Destructor Documentation

CTransaction::CTransaction ( )

Construct a CTransaction that qualifies as IsNull()

Definition at line 80 of file transaction.cpp.

CTransaction::CTransaction ( const CMutableTransaction tx)

Convert a CMutableTransaction into a CTransaction.

Definition at line 81 of file transaction.cpp.

CTransaction::CTransaction ( CMutableTransaction &&  tx)

Definition at line 82 of file transaction.cpp.

template<typename Stream >
CTransaction::CTransaction ( deserialize_type  ,
Stream &  s 
)
inline

This deserializing constructor is provided instead of an Unserialize method.

Unserialize is not possible, since it would require overwriting const fields.

Definition at line 319 of file transaction.h.

Member Function Documentation

uint256 CTransaction::ComputeHash ( ) const
private

Definition at line 66 of file transaction.cpp.

Here is the call graph for this function:

const uint256& CTransaction::GetHash ( ) const
inline

Definition at line 325 of file transaction.h.

Here is the caller graph for this function:

unsigned int CTransaction::GetTotalSize ( ) const

Get the total transaction size in bytes, including witness data.

"Total Size" defined in BIP141 and BIP144.

Returns
Total transaction size in bytes

Definition at line 95 of file transaction.cpp.

Here is the call graph for this function:

CAmount CTransaction::GetValueOut ( ) const

Definition at line 84 of file transaction.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint256 CTransaction::GetWitnessHash ( ) const

Definition at line 71 of file transaction.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CTransaction::HasCreateOrCall ( ) const

Definition at line 122 of file transaction.cpp.

Here is the caller graph for this function:

bool CTransaction::HasOpSpend ( ) const

Definition at line 130 of file transaction.cpp.

Here is the caller graph for this function:

bool CTransaction::HasWitness ( ) const
inline

Definition at line 378 of file transaction.h.

Here is the caller graph for this function:

bool CTransaction::IsCoinBase ( ) const
inline

Definition at line 349 of file transaction.h.

Here is the caller graph for this function:

bool CTransaction::IsCoinStake ( ) const
inline

Definition at line 354 of file transaction.h.

bool CTransaction::IsNormalTx ( ) const
inline

Definition at line 360 of file transaction.h.

bool CTransaction::IsNull ( ) const
inline

Definition at line 321 of file transaction.h.

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

Definition at line 312 of file transaction.h.

Here is the call graph for this function:

std::string CTransaction::ToString ( ) const

Definition at line 100 of file transaction.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

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

Definition at line 371 of file transaction.h.

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

Definition at line 366 of file transaction.h.

Member Data Documentation

const int32_t CTransaction::CURRENT_VERSION =2
static

Definition at line 279 of file transaction.h.

const uint256 CTransaction::hash
private

Memory only.

Definition at line 299 of file transaction.h.

const int32_t CTransaction::MAX_STANDARD_VERSION =2
static

Definition at line 285 of file transaction.h.

const uint32_t CTransaction::nLockTime

Definition at line 295 of file transaction.h.

const int32_t CTransaction::nVersion

Definition at line 294 of file transaction.h.

const std::vector<CTxIn> CTransaction::vin

Definition at line 292 of file transaction.h.

const std::vector<CTxOut> CTransaction::vout

Definition at line 293 of file transaction.h.


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