Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | BlockAssembler::CreateNewBlock(const CScript &scriptPubKeyIn) { | ||||
// Copy all the transactions into the block | // Copy all the transactions into the block | ||||
// FIXME: This should be removed as it is significant overhead. | // FIXME: This should be removed as it is significant overhead. | ||||
// See T479 | // See T479 | ||||
for (const CBlockTemplateEntry &tx : pblocktemplate->entries) { | for (const CBlockTemplateEntry &tx : pblocktemplate->entries) { | ||||
pblock->vtx.push_back(tx.tx); | pblock->vtx.push_back(tx.tx); | ||||
} | } | ||||
CValidationState state; | CValidationState state; | ||||
BlockValidationOptions validationOptions(false, false); | |||||
if (!TestBlockValidity(*config, state, *pblock, pindexPrev, | if (!TestBlockValidity(*config, state, *pblock, pindexPrev, | ||||
validationOptions)) { | BlockValidationOptions(*config) | ||||
.withCheckPoW(false) | |||||
.withCheckMerkleRoot(false))) { | |||||
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", | throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", | ||||
__func__, | __func__, | ||||
FormatStateMessage(state))); | FormatStateMessage(state))); | ||||
} | } | ||||
int64_t nTime2 = GetTimeMicros(); | int64_t nTime2 = GetTimeMicros(); | ||||
LogPrint(BCLog::BENCH, | LogPrint(BCLog::BENCH, | ||||
"CreateNewBlock() packages: %.2fms (%d packages, %d updated " | "CreateNewBlock() packages: %.2fms (%d packages, %d updated " | ||||
▲ Show 20 Lines • Show All 478 Lines • Show Last 20 Lines |