Changeset View
Changeset View
Standalone View
Standalone View
src/bench/duplicate_inputs.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | static void DuplicateInputs(benchmark::State &state) { | ||||
} | } | ||||
{ | { | ||||
thread_group.create_thread( | thread_group.create_thread( | ||||
std::bind(&CScheduler::serviceQueue, &scheduler)); | std::bind(&CScheduler::serviceQueue, &scheduler)); | ||||
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | ||||
LoadGenesisBlock(chainparams); | LoadGenesisBlock(chainparams); | ||||
CValidationState cvstate; | CValidationState cvstate; | ||||
ActivateBestChain(config, cvstate); | ActivateBestChain(config, cvstate); | ||||
assert(::chainActive.Tip() != nullptr); | assert(::ChainActive().Tip() != nullptr); | ||||
} | } | ||||
CBlock block{}; | CBlock block{}; | ||||
CMutableTransaction coinbaseTx{}; | CMutableTransaction coinbaseTx{}; | ||||
CMutableTransaction naughtyTx{}; | CMutableTransaction naughtyTx{}; | ||||
CBlockIndex *pindexPrev = ::chainActive.Tip(); | CBlockIndex *pindexPrev = ::ChainActive().Tip(); | ||||
assert(pindexPrev != nullptr); | assert(pindexPrev != nullptr); | ||||
block.nBits = | block.nBits = | ||||
GetNextWorkRequired(pindexPrev, &block, chainparams.GetConsensus()); | GetNextWorkRequired(pindexPrev, &block, chainparams.GetConsensus()); | ||||
block.nNonce = 0; | block.nNonce = 0; | ||||
auto nHeight = pindexPrev->nHeight + 1; | auto nHeight = pindexPrev->nHeight + 1; | ||||
// Make a coinbase TX | // Make a coinbase TX | ||||
coinbaseTx.vin.resize(1); | coinbaseTx.vin.resize(1); | ||||
Show All 39 Lines |