Changeset View
Changeset View
Standalone View
Standalone View
src/test/validation_flush_tests.cpp
Show All 15 Lines | |||||
//! | //! | ||||
//! @sa CChainState::GetCoinsCacheSizeState() | //! @sa CChainState::GetCoinsCacheSizeState() | ||||
//! | //! | ||||
BOOST_AUTO_TEST_CASE(getcoinscachesizestate) { | BOOST_AUTO_TEST_CASE(getcoinscachesizestate) { | ||||
BlockManager blockman{}; | BlockManager blockman{}; | ||||
CChainState chainstate{blockman}; | CChainState chainstate{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()); | 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); | ||||
auto &view = chainstate.CoinsTip(); | auto &view = chainstate.CoinsTip(); | ||||
//! Create and add a Coin with DynamicMemoryUsage of 80 bytes to the given | //! Create and add a Coin with DynamicMemoryUsage of 80 bytes to the given | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |