aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/setup_common.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-09-16 15:01:12 -0400
committerJames O'Beirne <james.obeirne@pm.me>2020-07-01 14:44:28 -0400
commitf36aaa6392fdbdac6891d92202d3efeff98754f4 (patch)
tree4cebab3fa566f6f9dc53228b92264f1cda6095b1 /src/test/util/setup_common.cpp
parentb223111da2e0e9ceccef75df8a20252b0094b7bc (diff)
downloadbitcoin-f36aaa6392fdbdac6891d92202d3efeff98754f4.tar.xz
Add CChainState::ResizeCoinsCaches
Also adds CCoinsViewCache::ReallocateCache() to attempt to free memory that the cacheCoins's allocator may be hanging onto when downsizing the cache. Adds `CChainState::m_coins{tip,db}_cache_size_bytes` data members so that we can reference cache size on a per-chainstate basis for flushing.
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r--src/test/util/setup_common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index 3b7a7c8d12..83916fd080 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -139,7 +139,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
::ChainstateActive().InitCoinsDB(
/* cache_size_bytes */ 1 << 23, /* in_memory */ true, /* should_wipe */ false);
assert(!::ChainstateActive().CanFlushToDisk());
- ::ChainstateActive().InitCoinsCache();
+ ::ChainstateActive().InitCoinsCache(1 << 23);
assert(::ChainstateActive().CanFlushToDisk());
if (!LoadGenesisBlock(chainparams)) {
throw std::runtime_error("LoadGenesisBlock failed.");