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

Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce values to make the block's hash satisfy proof-of-work requirements. More...

#include <core.h>

+ Inheritance diagram for CBlockHeader:
+ Collaboration diagram for CBlockHeader:

Public Member Functions

 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
 

Public Attributes

int nVersion
 
uint256 hashPrevBlock
 
uint256 hashMerkleRoot
 
unsigned int nTime
 
unsigned int nBits
 
unsigned int nNonce
 

Static Public Attributes

static const int CURRENT_VERSION =2
 

Detailed Description

Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce values to make the block's hash satisfy proof-of-work requirements.

When they solve the proof-of-work, they broadcast the block to everyone and the block is added to the block chain. The first transaction in the block is a special one that creates a new coin owned by the creator of the block.

Definition at line 344 of file core.h.

Constructor & Destructor Documentation

CBlockHeader::CBlockHeader ( )
inline

Definition at line 356 of file core.h.

Member Function Documentation

int64_t CBlockHeader::GetBlockTime ( ) const
inline

Definition at line 389 of file core.h.

Referenced by AcceptBlock(), blockToJSON(), CheckBlock(), PrintBlockTree(), and ProcessBlock().

+ Here is the caller graph for this function:

uint256 CBlockHeader::GetHash ( ) const

Definition at line 215 of file core.cpp.

References BEGIN, END, Hash(), nNonce, and nVersion.

Referenced by AcceptBlock(), AddToBlockIndex(), blockToJSON(), CheckBlock(), ConnectBlock(), GetTransaction(), CBlock::print(), ProcessBlock(), and ReadBlockFromDisk().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CBlockHeader::IMPLEMENT_SERIALIZE ( READWRITE(this->nVersion);  nVersion = this->nVersionREADWRITE(hashPrevBlock); READWRITE(hashMerkleRoot); READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce);)
inline

Definition at line 362 of file core.h.

bool CBlockHeader::IsNull ( ) const
inline

Definition at line 382 of file core.h.

Member Data Documentation

const int CBlockHeader::CURRENT_VERSION =2
static

Definition at line 348 of file core.h.

Referenced by UpdateTip().

uint256 CBlockHeader::hashMerkleRoot
uint256 CBlockHeader::hashPrevBlock
unsigned int CBlockHeader::nBits
unsigned int CBlockHeader::nNonce
unsigned int CBlockHeader::nTime
int CBlockHeader::nVersion

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