Master Core  v0.0.9 - 49a5c0d97abf09ef2911ddfe8d9551df59f9efd3-dirty
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Data Structures | Typedefs | Functions | Variables
miner.cpp File Reference
#include "miner.h"
#include "core.h"
#include "main.h"
#include "net.h"
+ Include dependency graph for miner.cpp:

Go to the source code of this file.

Data Structures

class  COrphan
 
class  TxPriorityCompare
 

Typedefs

typedef boost::tuple< double, double, const CTransaction * > TxPriority
 

Functions

static int FormatHashBlocks (void *pbuffer, unsigned int len)
 
void SHA256Transform (void *pstate, void *pinput, const void *pinit)
 Base sha256 mining transform. More...
 
CBlockTemplateCreateNewBlock (const CScript &scriptPubKeyIn)
 Generate a new block, without valid proof-of-work. More...
 
void IncrementExtraNonce (CBlock *pblock, CBlockIndex *pindexPrev, unsigned int &nExtraNonce)
 Modify the extranonce in a block. More...
 
void FormatHashBuffers (CBlock *pblock, char *pmidstate, char *pdata, char *phash1)
 Do mining precalculation. More...
 

Variables

static const unsigned int pSHA256InitState [8]
 
uint64_t nLastBlockTx = 0
 
uint64_t nLastBlockSize = 0
 

Typedef Documentation

typedef boost::tuple<double, double, const CTransaction*> TxPriority

Definition at line 84 of file miner.cpp.

Function Documentation

CBlockTemplate* CreateNewBlock ( const CScript scriptPubKeyIn)

Generate a new block, without valid proof-of-work.

Definition at line 107 of file miner.cpp.

References AllowFree(), CBlockTemplate::block, chainActive, CheckInputs(), CTransaction::ComputePriority(), ConnectBlock(), CTxMemPool::cs, cs_main, DEFAULT_BLOCK_MAX_SIZE, DEFAULT_BLOCK_MIN_SIZE, DEFAULT_BLOCK_PRIORITY_SIZE, COrphan::dFeePerKb, COrphan::dPriority, fDebug, GetArg(), CBlockIndex::GetBlockHash(), GetBlockValue(), GetBoolArg(), CCoinsViewCache::GetCoins(), CTransaction::GetHash(), GetLegacySigOpCount(), GetNextWorkRequired(), GetP2SHSigOpCount(), GetSerializeSize(), CCoinsViewCache::GetValueIn(), CTransaction::GetValueOut(), COutPoint::hash, CBlockHeader::hashPrevBlock, CCoinsViewCache::HaveCoins(), CCoinsViewCache::HaveInputs(), CTransaction::IsCoinBase(), IsFinalTx(), LOCK2, LogPrintf, CTxMemPool::mapTx, MAX_BLOCK_SIGOPS, MAX_BLOCK_SIZE, mempool, COutPoint::n, CBlockHeader::nBits, CCoins::nHeight, CBlockIndex::nHeight, nLastBlockSize, nLastBlockTx, CTransaction::nMinRelayTxFee, CBlockHeader::nNonce, OP_0, pcoinsTip, CBlockIndex::pprev, CTxIn::prevout, PROTOCOL_VERSION, COrphan::ptx, SCRIPT_VERIFY_P2SH, SER_NETWORK, COrphan::setDependsOn, CChain::Tip(), base_uint< BITS >::ToString(), UpdateCoins(), UpdateTime(), CTransaction::vin, CCoins::vout, CTransaction::vout, CBlock::vtx, CBlockTemplate::vTxFees, and CBlockTemplate::vTxSigOps.

Referenced by getblocktemplate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int FormatHashBlocks ( void *  pbuffer,
unsigned int  len 
)
static

Definition at line 19 of file miner.cpp.

Referenced by FormatHashBuffers().

+ Here is the caller graph for this function:

void FormatHashBuffers ( CBlock pblock,
char *  pmidstate,
char *  pdata,
char *  phash1 
)

Do mining precalculation.

Definition at line 365 of file miner.cpp.

References ByteReverse(), FormatHashBlocks(), CBlockHeader::hashMerkleRoot, CBlockHeader::hashPrevBlock, memcpy(), CBlockHeader::nBits, CBlockHeader::nNonce, CBlockHeader::nTime, CBlockHeader::nVersion, pSHA256InitState, and SHA256Transform().

+ Here is the call graph for this function:

void IncrementExtraNonce ( CBlock pblock,
CBlockIndex pindexPrev,
unsigned int nExtraNonce 
)

Modify the extranonce in a block.

Definition at line 347 of file miner.cpp.

References CBlock::BuildMerkleTree(), COINBASE_FLAGS, CBlockHeader::hashMerkleRoot, CBlockHeader::hashPrevBlock, CBlockIndex::nHeight, and CBlock::vtx.

+ Here is the call graph for this function:

void SHA256Transform ( void *  pstate,
void *  pinput,
const void *  pinit 
)

Base sha256 mining transform.

Definition at line 37 of file miner.cpp.

References ByteReverse(), and Checkpoints::data.

Referenced by FormatHashBuffers().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uint64_t nLastBlockSize = 0

Definition at line 81 of file miner.cpp.

Referenced by CreateNewBlock(), and getmininginfo().

uint64_t nLastBlockTx = 0

Definition at line 80 of file miner.cpp.

Referenced by CreateNewBlock(), and getmininginfo().

const unsigned int pSHA256InitState[8]
static
Initial value:
=
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}

Definition at line 34 of file miner.cpp.

Referenced by FormatHashBuffers().