Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CBlock Class Reference

#include <core.h>

+ Inheritance diagram for CBlock:
+ Collaboration diagram for CBlock:

Public Member Functions

 CBlock ()
 
 CBlock (const CBlockHeader &header)
 
 IMPLEMENT_SERIALIZE (READWRITE(*(CBlockHeader *) this);READWRITE(vtx);) void SetNull()
 
CBlockHeader GetBlockHeader () const
 
uint256 BuildMerkleTree () const
 
const uint256GetTxHash (unsigned int nIndex) const
 
std::vector< uint256GetMerkleBranch (int nIndex) const
 
void print () const
 
- Public Member Functions inherited from CBlockHeader
 CBlockHeader ()
 
 IMPLEMENT_SERIALIZE (READWRITE(this->nVersion);nVersion=this->nVersion;READWRITE(hashPrevBlock);READWRITE(hashMerkleRoot);READWRITE(nTime);READWRITE(nBits);READWRITE(nNonce);) void SetNull()
 
bool IsNull () const
 
uint256 GetHash () const
 
int64_t GetBlockTime () const
 

Static Public Member Functions

static uint256 CheckMerkleBranch (uint256 hash, const std::vector< uint256 > &vMerkleBranch, int nIndex)
 

Public Attributes

std::vector< CTransactionvtx
 
std::vector< uint256vMerkleTree
 
- Public Attributes inherited from CBlockHeader
int nVersion
 
uint256 hashPrevBlock
 
uint256 hashMerkleRoot
 
unsigned int nTime
 
unsigned int nBits
 
unsigned int nNonce
 

Additional Inherited Members

- Static Public Attributes inherited from CBlockHeader
static const int CURRENT_VERSION =2
 

Detailed Description

Definition at line 396 of file core.h.

Constructor & Destructor Documentation

CBlock::CBlock ( )
inline

Definition at line 405 of file core.h.

CBlock::CBlock ( const CBlockHeader header)
inline

Definition at line 410 of file core.h.

Member Function Documentation

uint256 CBlock::BuildMerkleTree ( ) const

Definition at line 220 of file core.cpp.

References BEGIN, END, CTransaction::GetHash(), Hash(), vMerkleTree, and vtx.

Referenced by AppInit2(), CheckBlock(), GetMerkleBranch(), IncrementExtraNonce(), and ProcessBlock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint256 CBlock::CheckMerkleBranch ( uint256  hash,
const std::vector< uint256 > &  vMerkleBranch,
int  nIndex 
)
static

Definition at line 255 of file core.cpp.

References BEGIN, END, and Hash().

Referenced by CMerkleTx::GetDepthInMainChainINTERNAL().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CBlockHeader CBlock::GetBlockHeader ( ) const
inline

Definition at line 429 of file core.h.

References CBlockHeader::hashMerkleRoot, CBlockHeader::hashPrevBlock, CBlockHeader::nBits, CBlockHeader::nNonce, CBlockHeader::nTime, and CBlockHeader::nVersion.

Referenced by CMerkleBlock::CMerkleBlock().

+ Here is the caller graph for this function:

std::vector< uint256 > CBlock::GetMerkleBranch ( int  nIndex) const

Definition at line 239 of file core.cpp.

References BuildMerkleTree(), vMerkleTree, and vtx.

+ Here is the call graph for this function:

const uint256& CBlock::GetTxHash ( unsigned int  nIndex) const
inline

Definition at line 443 of file core.h.

Referenced by AddToBlockIndex(), CheckBlock(), and ConnectBlock().

+ Here is the caller graph for this function:

CBlock::IMPLEMENT_SERIALIZE ( READWRITE(*(CBlockHeader *) this);READWRITE(vtx);  )
inline

Definition at line 417 of file core.h.

void CBlock::print ( ) const

Definition at line 270 of file core.cpp.

References CBlockHeader::GetHash(), CBlockHeader::hashMerkleRoot, CBlockHeader::hashPrevBlock, LogPrintf, CBlockHeader::nBits, CBlockHeader::nNonce, CBlockHeader::nTime, CBlockHeader::nVersion, base_uint< BITS >::ToString(), vMerkleTree, and vtx.

Referenced by AppInit2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<uint256> CBlock::vMerkleTree
mutable

Definition at line 403 of file core.h.

Referenced by BuildMerkleTree(), CheckBlock(), GetMerkleBranch(), and print().

std::vector<CTransaction> CBlock::vtx

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