34 auto mining{MakeMining()};
35 BOOST_REQUIRE(mining);
39 std::unique_ptr<BlockTemplate> block_template;
42 const int64_t genesis_time{
WITH_LOCK(
cs_main,
return m_node.chainman->ActiveChain().Tip()->GetBlockTime())};
45 block_template = mining->createNewBlock(options,
false);
46 BOOST_REQUIRE(block_template);
49 BOOST_REQUIRE_EQUAL(block_template->getBlockHeader().nTime, genesis_time + 3 * 60);
54 auto should_be_nullptr = block_template->waitNext(wait_options);
55 BOOST_REQUIRE(should_be_nullptr ==
nullptr);
60 SetMockTime(m_node.chainman->ActiveChain().Tip()->GetBlockTime() + 20 * 60);
62 should_be_nullptr = block_template->waitNext(wait_options);
63 BOOST_REQUIRE(should_be_nullptr ==
nullptr);
70 SetMockTime(m_node.chainman->ActiveChain().Tip()->GetBlockTime() + 20 * 60 + 1);
72 block_template = block_template->waitNext(wait_options);
73 BOOST_REQUIRE(block_template);
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.