From 97bf377bd1f27ad841e1414e74361923a9f794f5 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 22 Oct 2015 15:49:53 -0700 Subject: Add CCoinsViewCache::HaveCoinsInCache to check if a tx is cached --- src/coins.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/coins.cpp') diff --git a/src/coins.cpp b/src/coins.cpp index 060d6b7c5d..122bf4e48d 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -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(); -- cgit v1.2.3