Changeset View
Changeset View
Standalone View
Standalone View
src/bench/duplicate_inputs.cpp
Show All 29 Lines | static void DuplicateInputs(benchmark::Bench &bench) { | ||||
const CChainParams &chainParams = Params(); | const CChainParams &chainParams = Params(); | ||||
const Consensus::Params &consensusParams = chainParams.GetConsensus(); | const Consensus::Params &consensusParams = chainParams.GetConsensus(); | ||||
CBlock block{}; | CBlock block{}; | ||||
CMutableTransaction coinbaseTx{}; | CMutableTransaction coinbaseTx{}; | ||||
CMutableTransaction naughtyTx{}; | CMutableTransaction naughtyTx{}; | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
assert(std::addressof(::ChainActive()) == | |||||
std::addressof(test_setup.m_node.chainman->ActiveChain())); | |||||
CBlockIndex *pindexPrev = test_setup.m_node.chainman->ActiveChain().Tip(); | CBlockIndex *pindexPrev = test_setup.m_node.chainman->ActiveChain().Tip(); | ||||
assert(pindexPrev != nullptr); | assert(pindexPrev != nullptr); | ||||
block.nBits = GetNextWorkRequired(pindexPrev, &block, chainParams); | block.nBits = GetNextWorkRequired(pindexPrev, &block, chainParams); | ||||
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 33 Lines |