diff options
| author | James O'Beirne <[email protected]> | 2019-09-16 15:01:12 -0400 |
|---|---|---|
| committer | James O'Beirne <[email protected]> | 2020-07-01 14:44:28 -0400 |
| commit | f36aaa6392fdbdac6891d92202d3efeff98754f4 (patch) | |
| tree | 4cebab3fa566f6f9dc53228b92264f1cda6095b1 /src/test/util/setup_common.cpp | |
| parent | txdb: add CCoinsViewDB::ChangeCacheSize (diff) | |
| download | discoin-f36aaa6392fdbdac6891d92202d3efeff98754f4.tar.xz discoin-f36aaa6392fdbdac6891d92202d3efeff98754f4.zip | |
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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 3b7a7c8d1..83916fd08 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."); |