From 79bd941da6105080fb52fe2c1a2b1995ac8201ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Fri, 18 Apr 2025 11:23:27 +0200 Subject: [PATCH] coins: reset `cachedCoinsUsage` in Flush() only after the map is cleared Prevents the counter from dropping to 0 while cacheCoins still holds objects --- src/coins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coins.cpp b/src/coins.cpp index 8e3afc7ff62..42e83dab8c3 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -254,8 +254,8 @@ bool CCoinsViewCache::Flush() { if (fOk) { cacheCoins.clear(); ReallocateCache(); + cachedCoinsUsage = 0; } - cachedCoinsUsage = 0; return fOk; }