| 129 | } |
| 130 | |
| 131 | std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, |
| 132 | const node::BlockCreateOptions& assembler_options) |
| 133 | { |
| 134 | auto mining = interfaces::MakeMining(node); |
| 135 | auto block_template = mining->createNewBlock(assembler_options, /*cooldown=*/false); |
| 136 | auto block = std::make_shared<CBlock>(Assert(block_template)->getBlock()); |
| 137 | |
| 138 | LOCK(cs_main); |
| 139 | block->nTime = Assert(node.chainman)->ActiveChain().Tip()->GetMedianTimePast() + 1; |
| 140 | block->hashMerkleRoot = BlockMerkleRoot(*block); |
| 141 | |
| 142 | return block; |
| 143 | } |
no test coverage detected