Changeset View
Changeset View
Standalone View
Standalone View
src/coins.cpp
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | |||||
bool CCoinsViewCache::HaveCoin(const COutPoint &outpoint) const { | bool CCoinsViewCache::HaveCoin(const COutPoint &outpoint) const { | ||||
CCoinsMap::const_iterator it = FetchCoin(outpoint); | CCoinsMap::const_iterator it = FetchCoin(outpoint); | ||||
return it != cacheCoins.end() && !it->second.coin.IsSpent(); | return it != cacheCoins.end() && !it->second.coin.IsSpent(); | ||||
} | } | ||||
bool CCoinsViewCache::HaveCoinInCache(const COutPoint &outpoint) const { | bool CCoinsViewCache::HaveCoinInCache(const COutPoint &outpoint) const { | ||||
CCoinsMap::const_iterator it = cacheCoins.find(outpoint); | CCoinsMap::const_iterator it = cacheCoins.find(outpoint); | ||||
return it != cacheCoins.end(); | return (it != cacheCoins.end() && !it->second.coin.IsSpent()); | ||||
} | } | ||||
uint256 CCoinsViewCache::GetBestBlock() const { | uint256 CCoinsViewCache::GetBestBlock() const { | ||||
if (hashBlock.IsNull()) { | if (hashBlock.IsNull()) { | ||||
hashBlock = base->GetBestBlock(); | hashBlock = base->GetBestBlock(); | ||||
} | } | ||||
return hashBlock; | return hashBlock; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |