MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ResizeCache

Method ResizeCache

src/txdb.cpp:73–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void CCoinsViewDB::ResizeCache(size_t new_cache_size)
74{
75 // We can't do this operation with an in-memory DB since we'll lose all the coins upon
76 // reset.
77 if (!m_db_params.memory_only) {
78 LOCK(m_db_mutex);
79 // Have to do a reset first to get the original `m_db` state to release its
80 // filesystem lock.
81 m_db.reset();
82 m_db_params.cache_bytes = new_cache_size;
83 m_db_params.wipe_data = false;
84 m_db = std::make_unique<CDBWrapper>(m_db_params);
85 }
86}
87
88std::optional<Coin> CCoinsViewDB::GetCoin(const COutPoint& outpoint) const
89{

Callers 1

ResizeCoinsCachesMethod · 0.80

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected