What changed, and why it matters
This commit is a pure code cleanup: it moves two internal helper functions (FetchCoin and ReallocateCache) into the existing private section of a C++ class. There are no functional changes, no bug fixes, and no security implications.
No security action needed. This is a non-functional refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff only changes access specifiers and reorders declarations in src/coins.h. ReallocateCache is moved from public to the existing private section, and FetchCoin is moved from a trailing private section into the same private section. No signatures, implementations, logic, or behavior are modified.
Changed components
src/coins.hInspect captured patch +13 / −14
diff --git a/src/coins.h b/src/coins.h
index c854893b..6fcf1092 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -438,6 +438,19 @@ class CCoinsViewCache : public CCoinsViewBacked
private:
const bool m_deterministic;
+ //! Force a reallocation of the cache map. This is required when downsizing
+ //! the cache because the map's allocator may be hanging onto a lot of
+ //! memory despite having called .clear().
+ //!
+ //! See: https://stackoverflow.com/questions/42114044/how-to-release-unordered-map-memory
+ void ReallocateCache();
+
+ /**
+ * @note this is marked const, but may actually append to `cacheCoins`, increasing
+ * memory usage.
+ */
+ CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;
+
protected:
/**
* Make mutable so that we can "fill the cache" even from Get-methods
@@ -555,13 +568,6 @@ public:
//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
bool HaveInputs(const CTransaction& tx) const;
- //! Force a reallocation of the cache map. This is required when downsizing
- //! the cache because the map's allocator may be hanging onto a lot of
- //! memory despite having called .clear().
- //!
- //! See: https://stackoverflow.com/questions/42114044/how-to-release-unordered-map-memory
- void ReallocateCache();
-
//! Run an internal sanity check on the cache data structure. */
void SanityCheck() const;
@@ -583,13 +589,6 @@ public:
//! Create a scoped guard that will call `Reset()` on this cache when it goes out of scope.
[[nodiscard]] ResetGuard CreateResetGuard() noexcept { return ResetGuard{*this}; }
-
-private:
- /**
- * @note this is marked const, but may actually append to `cacheCoins`, increasing
- * memory usage.
- */
- CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;
};
/**
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.