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

Method Uncache

src/coins.cpp:291–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void CCoinsViewCache::Uncache(const COutPoint& hash)
292{
293 CCoinsMap::iterator it = cacheCoins.find(hash);
294 if (it != cacheCoins.end() && !it->second.IsDirty()) {
295 Assume(TrySub(cachedCoinsUsage, it->second.coin.DynamicMemoryUsage()));
296 TRACEPOINT(utxocache, uncache,
297 hash.hash.data(),
298 (uint32_t)hash.n,
299 (uint32_t)it->second.coin.nHeight,
300 (int64_t)it->second.coin.out.nValue,
301 (bool)it->second.coin.IsCoinBase());
302 cacheCoins.erase(it);
303 }
304}
305
306unsigned int CCoinsViewCache::GetCacheSize() const {
307 return cacheCoins.size();

Callers 7

validation.cppFile · 0.80
CleanupTemporaryCoinsMethod · 0.80
AcceptToMemoryPoolFunction · 0.80
SimulationTestMethod · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
TestCoinsViewFunction · 0.80
FUZZ_TARGETFunction · 0.80

Calls 8

TrySubFunction · 0.85
findMethod · 0.80
endMethod · 0.45
IsDirtyMethod · 0.45
DynamicMemoryUsageMethod · 0.45
dataMethod · 0.45
IsCoinBaseMethod · 0.45
eraseMethod · 0.45

Tested by 4

SimulationTestMethod · 0.64
BOOST_FIXTURE_TEST_CASEFunction · 0.64
TestCoinsViewFunction · 0.64
FUZZ_TARGETFunction · 0.64