Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | for (int i = 0; i < num_blocks; i++) { | ||||
m_coinbase_txns.push_back(b.vtx[0]); | m_coinbase_txns.push_back(b.vtx[0]); | ||||
} | } | ||||
} | } | ||||
CBlock TestChain100Setup::CreateAndProcessBlock( | CBlock TestChain100Setup::CreateAndProcessBlock( | ||||
const std::vector<CMutableTransaction> &txns, const CScript &scriptPubKey) { | const std::vector<CMutableTransaction> &txns, const CScript &scriptPubKey) { | ||||
const Config &config = GetConfig(); | const Config &config = GetConfig(); | ||||
CTxMemPool empty_pool; | CTxMemPool empty_pool; | ||||
CBlock block = BlockAssembler(config, empty_pool) | CBlock block = BlockAssembler(config, ::ChainstateActive(), empty_pool) | ||||
.CreateNewBlock(::ChainstateActive(), scriptPubKey) | .CreateNewBlock(scriptPubKey) | ||||
->block; | ->block; | ||||
Assert(block.vtx.size() == 1); | Assert(block.vtx.size() == 1); | ||||
for (const CMutableTransaction &tx : txns) { | for (const CMutableTransaction &tx : txns) { | ||||
block.vtx.push_back(MakeTransactionRef(tx)); | block.vtx.push_back(MakeTransactionRef(tx)); | ||||
} | } | ||||
// Order transactions by canonical order | // Order transactions by canonical order | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |