| 75 | } |
| 76 | |
| 77 | std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey) |
| 78 | { |
| 79 | auto block = std::make_shared<CBlock>( |
| 80 | BlockAssembler{Assert(node.chainman)->ActiveChainstate(), *Assert(node.mempool), Params()} |
| 81 | .CreateNewBlock(coinbase_scriptPubKey) |
| 82 | ->block); |
| 83 | |
| 84 | LOCK(cs_main); |
| 85 | block->nTime = Assert(node.chainman)->ActiveChain().Tip()->GetMedianTimePast() + 1; |
| 86 | block->hashMerkleRoot = BlockMerkleRoot(*block); |
| 87 | |
| 88 | return block; |
| 89 | } |
no test coverage detected