Changeset View
Changeset View
Standalone View
Standalone View
src/test/validation_flush_tests.cpp
Show All 11 Lines | |||||
BOOST_FIXTURE_TEST_SUITE(validation_flush_tests, BasicTestingSetup) | BOOST_FIXTURE_TEST_SUITE(validation_flush_tests, BasicTestingSetup) | ||||
//! Test utilities for detecting when we need to flush the coins cache based | //! Test utilities for detecting when we need to flush the coins cache based | ||||
//! on estimated memory usage. | //! on estimated memory usage. | ||||
//! | //! | ||||
//! @sa CChainState::GetCoinsCacheSizeState() | //! @sa CChainState::GetCoinsCacheSizeState() | ||||
//! | //! | ||||
BOOST_AUTO_TEST_CASE(getcoinscachesizestate) { | BOOST_AUTO_TEST_CASE(getcoinscachesizestate) { | ||||
CTxMemPool mempool; | |||||
BlockManager blockman{}; | BlockManager blockman{}; | ||||
CChainState chainstate{blockman}; | CChainState chainstate{mempool, blockman}; | ||||
chainstate.InitCoinsDB(/*cache_size_bytes*/ 1 << 10, /*in_memory*/ true, | chainstate.InitCoinsDB(/*cache_size_bytes*/ 1 << 10, /*in_memory*/ true, | ||||
/*should_wipe*/ false); | /*should_wipe*/ false); | ||||
WITH_LOCK(::cs_main, chainstate.InitCoinsCache(1 << 10)); | WITH_LOCK(::cs_main, chainstate.InitCoinsCache(1 << 10)); | ||||
CTxMemPool tx_pool{}; | CTxMemPool tx_pool{}; | ||||
constexpr bool is_64_bit = sizeof(void *) == 8; | constexpr bool is_64_bit = sizeof(void *) == 8; | ||||
LOCK(::cs_main); | LOCK(::cs_main); | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |