10#include <boost/test/unit_test.hpp>
29 BOOST_CHECK(!coin_stats_index.LookUpStats(block_index, coin_stats));
33 BOOST_CHECK(!coin_stats_index.BlockUntilSyncedToCurrentChain());
35 BOOST_REQUIRE(coin_stats_index.Start(
m_node.
chainman->ActiveChainstate()));
39 const auto timeout = GetTime<std::chrono::seconds>() + 120s;
40 while (!coin_stats_index.BlockUntilSyncedToCurrentChain()) {
41 BOOST_REQUIRE(timeout > GetTime<std::chrono::milliseconds>());
51 BOOST_CHECK(coin_stats_index.LookUpStats(genesis_block_index, coin_stats));
54 coin_stats_index.LookUpStats(block_index, coin_stats);
57 std::vector<CMutableTransaction> noTxns;
58 CreateAndProcessBlock(noTxns, script_pub_key);
61 BOOST_CHECK(coin_stats_index.BlockUntilSyncedToCurrentChain());
69 coin_stats_index.LookUpStats(new_block_index, new_coin_stats);
74 coin_stats_index.Stop();
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Serialized script, used inside transaction inputs and outputs.
CoinStatsIndex maintains statistics on the UTXO set.
BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
BOOST_AUTO_TEST_SUITE(cuckoocache_tests)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
std::unique_ptr< ChainstateManager > chainman
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
void UninterruptibleSleep(const std::chrono::microseconds &n)