MCPcopy Create free account
hub / github.com/ElementsProject/elements / CreateAndProcessBlock

Method CreateAndProcessBlock

src/test/util/setup_common.cpp:315–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315CBlock TestChain100Setup::CreateAndProcessBlock(
316 const std::vector<CMutableTransaction>& txns,
317 const CScript& scriptPubKey,
318 CChainState* chainstate)
319{
320 if (!chainstate) {
321 chainstate = &Assert(m_node.chainman)->ActiveChainstate();
322 }
323
324 const CChainParams& chainparams = Params();
325 const CBlock block = this->CreateBlock(txns, scriptPubKey, *chainstate);
326 std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
327 Assert(m_node.chainman)->ProcessNewBlock(chainparams, shared_pblock, true, nullptr);
328
329 return block;
330}
331
332
333CMutableTransaction TestChain100Setup::CreateValidMempoolTransaction(CTransactionRef input_transaction,

Callers 1

TestGUIFunction · 0.80

Calls 3

CreateBlockMethod · 0.95
ProcessNewBlockMethod · 0.80
ParamsClass · 0.50

Tested by

no test coverage detected