Add CCoinsViewCache::HaveCoinsInCache to check if a tx is cached

This commit is contained in:
Matt Corallo
2015-10-22 15:49:53 -07:00
parent 677aa3d88c
commit 97bf377bd1
2 changed files with 12 additions and 0 deletions

View File

@@ -144,6 +144,11 @@ bool CCoinsViewCache::HaveCoins(const uint256 &txid) const {
return (it != cacheCoins.end() && !it->second.coins.vout.empty());
}
bool CCoinsViewCache::HaveCoinsInCache(const uint256 &txid) const {
CCoinsMap::const_iterator it = cacheCoins.find(txid);
return it != cacheCoins.end();
}
uint256 CCoinsViewCache::GetBestBlock() const {
if (hashBlock.IsNull())
hashBlock = base->GetBestBlock();