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

Method Uncache

src/coins.cpp:330–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void CCoinsViewCache::Uncache(const COutPoint& point)
331{
332 CCoinsMap::iterator it = cacheCoins.find(native_key(point));
333 if (it != cacheCoins.end() && it->second.flags == 0) {
334 cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();
335 TRACE5(utxocache, uncache,
336 it->first.second.hash.data(),
337 it->first.second.n,
338 (uint32_t)it->second.coin.nHeight,
339 it->second.coin.out.nValue.IsExplicit() ? (int64_t)it->second.coin.out.nValue.GetAmount() : 0,
340 (bool)it->second.coin.IsCoinBase());
341 cacheCoins.erase(it);
342 }
343}
344
345unsigned int CCoinsViewCache::GetCacheSize() const {
346 return cacheCoins.size();

Callers 5

validation.cppFile · 0.80
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.80
SimulationTestFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80

Calls 9

native_keyFunction · 0.85
findMethod · 0.80
IsExplicitMethod · 0.80
GetAmountMethod · 0.80
endMethod · 0.45
DynamicMemoryUsageMethod · 0.45
dataMethod · 0.45
IsCoinBaseMethod · 0.45
eraseMethod · 0.45

Tested by 3

SimulationTestFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGET_INITFunction · 0.64