| 293 | } |
| 294 | |
| 295 | CBlock TestChain100Setup::CreateBlock( |
| 296 | const std::vector<CMutableTransaction>& txns, |
| 297 | const CScript& scriptPubKey, |
| 298 | CChainState& chainstate) |
| 299 | { |
| 300 | const CChainParams& chainparams = Params(); |
| 301 | CTxMemPool empty_pool; |
| 302 | CBlock block = BlockAssembler(chainstate, empty_pool, chainparams).CreateNewBlock(scriptPubKey)->block; |
| 303 | |
| 304 | Assert(block.vtx.size() == 1); |
| 305 | for (const CMutableTransaction& tx : txns) { |
| 306 | block.vtx.push_back(MakeTransactionRef(tx)); |
| 307 | } |
| 308 | RegenerateCommitments(block, *Assert(m_node.chainman)); |
| 309 | |
| 310 | while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; |
| 311 | |
| 312 | return block; |
| 313 | } |
| 314 | |
| 315 | CBlock TestChain100Setup::CreateAndProcessBlock( |
| 316 | const std::vector<CMutableTransaction>& txns, |
no test coverage detected