aboutsummaryrefslogtreecommitdiff
path: root/src/coins.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2015-10-21 17:41:40 -0700
committerMatt Corallo <[email protected]>2015-12-01 15:50:39 -0800
commit74d0f902628472cd0cee66121ef0311eec201c40 (patch)
tree7aa06dc2b0bc863b3b60b340d3a8919283b13650 /src/coins.cpp
parentMerge pull request #6898 (diff)
downloaddiscoin-74d0f902628472cd0cee66121ef0311eec201c40.tar.xz
discoin-74d0f902628472cd0cee66121ef0311eec201c40.zip
Add method to remove a tx from CCoinsViewCache if it is unchanged
Diffstat (limited to 'src/coins.cpp')
-rw-r--r--src/coins.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/coins.cpp b/src/coins.cpp
index 723e11470..060d6b7c5 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -206,6 +206,15 @@ bool CCoinsViewCache::Flush() {
return fOk;
}
+void CCoinsViewCache::Uncache(const uint256& hash)
+{
+ CCoinsMap::iterator it = cacheCoins.find(hash);
+ if (it != cacheCoins.end() && it->second.flags == 0) {
+ cachedCoinsUsage -= it->second.coins.DynamicMemoryUsage();
+ cacheCoins.erase(it);
+ }
+}
+
unsigned int CCoinsViewCache::GetCacheSize() const {
return cacheCoins.size();
}