MCPcopy Create free account
hub / github.com/LUX-Core/lux / FetchCoins

Method FetchCoins

src/coins.cpp:109–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109CCoinsMap::const_iterator CCoinsViewCache::FetchCoins(const uint256& txid) const
110{
111 CCoinsMap::iterator it = cacheCoins.find(txid);
112 if (it != cacheCoins.end())
113 return it;
114 CCoins tmp;
115 if (!base->GetCoins(txid, tmp))
116 return cacheCoins.end();
117 CCoinsMap::iterator ret = cacheCoins.insert(std::make_pair(txid, CCoinsCacheEntry())).first;
118 tmp.swap(ret->second.coins);
119 if (ret->second.coins.IsPruned()) {
120 // The parent only has an empty entry for this txid; we can consider our
121 // version as fresh.
122 ret->second.flags = CCoinsCacheEntry::FRESH;
123 }
124 cachedCoinsUsage += ret->second.coins.DynamicMemoryUsage();
125 return ret;
126}
127
128bool CCoinsViewCache::GetCoins(const uint256& txid, CCoins& coins) const
129{

Callers

nothing calls this directly

Calls 8

CCoinsCacheEntryClass · 0.85
IsPrunedMethod · 0.80
findMethod · 0.45
endMethod · 0.45
GetCoinsMethod · 0.45
insertMethod · 0.45
swapMethod · 0.45
DynamicMemoryUsageMethod · 0.45

Tested by

no test coverage detected