Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | BlockAssembler::CreateNewBlock(const CScript &scriptPubKeyIn) { | ||||
LogPrintf("CreateNewBlock(): total size: %u txs: %u fees: %ld sigops %d\n", | LogPrintf("CreateNewBlock(): total size: %u txs: %u fees: %ld sigops %d\n", | ||||
nSerializeSize, nBlockTx, nFees, nBlockSigOps); | nSerializeSize, nBlockTx, nFees, nBlockSigOps); | ||||
// Fill in header. | // Fill in header. | ||||
pblock->hashPrevBlock = pindexPrev->GetBlockHash(); | pblock->hashPrevBlock = pindexPrev->GetBlockHash(); | ||||
UpdateTime(pblock, *config, pindexPrev); | UpdateTime(pblock, *config, pindexPrev); | ||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, *config); | pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, *config); | ||||
pblock->nNonce = 0; | pblock->nNonce = 0; | ||||
pblocktemplate->vTxSigOpsCount[0] = | pblocktemplate->vTxSigOpsCount[0] = GetSigOpCountWithoutP2SH( | ||||
GetSigOpCountWithoutP2SH(*pblock->vtx[0]); | *pblock->vtx[0], STANDARD_CHECKDATASIG_VERIFY_FLAGS); | ||||
CValidationState state; | CValidationState state; | ||||
BlockValidationOptions validationOptions(false, false); | BlockValidationOptions validationOptions(false, false); | ||||
if (!TestBlockValidity(*config, state, *pblock, pindexPrev, | if (!TestBlockValidity(*config, state, *pblock, pindexPrev, | ||||
validationOptions)) { | validationOptions)) { | ||||
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", | throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", | ||||
__func__, | __func__, | ||||
FormatStateMessage(state))); | FormatStateMessage(state))); | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |