File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,15 @@ bool CCoinsViewCache::Flush() {
206
206
return fOk ;
207
207
}
208
208
209
+ void CCoinsViewCache::Uncache (const uint256& hash)
210
+ {
211
+ CCoinsMap::iterator it = cacheCoins.find (hash);
212
+ if (it != cacheCoins.end () && it->second .flags == 0 ) {
213
+ cachedCoinsUsage -= it->second .coins .DynamicMemoryUsage ();
214
+ cacheCoins.erase (it);
215
+ }
216
+ }
217
+
209
218
unsigned int CCoinsViewCache::GetCacheSize () const {
210
219
return cacheCoins.size ();
211
220
}
Original file line number Diff line number Diff line change @@ -437,6 +437,12 @@ class CCoinsViewCache : public CCoinsViewBacked
437
437
*/
438
438
bool Flush ();
439
439
440
+ /* *
441
+ * Removes the transaction with the given hash from the cache, if it is
442
+ * not modified.
443
+ */
444
+ void Uncache (const uint256 &txid);
445
+
440
446
// ! Calculate the size of the cache (in number of transactions)
441
447
unsigned int GetCacheSize () const ;
442
448
You can’t perform that action at this time.
0 commit comments