MCPcopy Create free account
hub / github.com/ElementsProject/elements / ResizeCache

Method ResizeCache

src/txdb.cpp:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 m_is_memory(fMemory) { }
78
79void CCoinsViewDB::ResizeCache(size_t new_cache_size)
80{
81 // We can't do this operation with an in-memory DB since we'll lose all the coins upon
82 // reset.
83 if (!m_is_memory) {
84 // Have to do a reset first to get the original `m_db` state to release its
85 // filesystem lock.
86 m_db.reset();
87 m_db = std::make_unique<CDBWrapper>(
88 m_ldb_path, new_cache_size, m_is_memory, /*fWipe*/ false, /*obfuscate*/ true);
89 }
90}
91
92bool CCoinsViewDB::GetCoin(const COutPoint &outpoint, Coin &coin) const {
93 return m_db->Read(CoinEntry(&outpoint), coin);

Callers 1

ResizeCoinsCachesMethod · 0.80

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected