| 289 | } |
| 290 | |
| 291 | void 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 | |
| 306 | unsigned int CCoinsViewCache::GetCacheSize() const { |
| 307 | return cacheCoins.size(); |