Changeset View
Changeset View
Standalone View
Standalone View
src/test/validation_block_tests.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
std::shared_ptr<CBlock> MinerTestingSetup::Block(const Config &config, | std::shared_ptr<CBlock> MinerTestingSetup::Block(const Config &config, | ||||
const BlockHash &prev_hash) { | const BlockHash &prev_hash) { | ||||
static int i = 0; | static int i = 0; | ||||
static uint64_t time = config.GetChainParams().GenesisBlock().nTime; | static uint64_t time = config.GetChainParams().GenesisBlock().nTime; | ||||
CScript pubKey; | CScript pubKey; | ||||
pubKey << i++ << OP_TRUE; | pubKey << i++ << OP_TRUE; | ||||
auto ptemplate = BlockAssembler(config, *m_node.mempool) | auto ptemplate = BlockAssembler(config, m_node.chainman->ActiveChainstate(), | ||||
.CreateNewBlock(::ChainstateActive(), pubKey); | *m_node.mempool) | ||||
.CreateNewBlock(pubKey); | |||||
auto pblock = std::make_shared<CBlock>(ptemplate->block); | auto pblock = std::make_shared<CBlock>(ptemplate->block); | ||||
pblock->hashPrevBlock = prev_hash; | pblock->hashPrevBlock = prev_hash; | ||||
pblock->nTime = ++time; | pblock->nTime = ++time; | ||||
pubKey.clear(); | pubKey.clear(); | ||||
{ | { | ||||
pubKey << OP_HASH160 << ToByteVector(CScriptID(CScript() << OP_TRUE)) | pubKey << OP_HASH160 << ToByteVector(CScriptID(CScript() << OP_TRUE)) | ||||
<< OP_EQUAL; | << OP_EQUAL; | ||||
▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines |