aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 7a03adf558..c924bb3c34 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1656,7 +1656,7 @@ bool CScriptCheck::operator()() {
static CuckooCache::cache<uint256, SignatureCacheHasher> g_scriptExecutionCache;
static CSHA256 g_scriptExecutionCacheHasher;
-bool InitScriptExecutionCache(int64_t max_size_bytes)
+bool InitScriptExecutionCache(size_t max_size_bytes)
{
// Setup the salted hasher
uint256 nonce = GetRandHash();
@@ -1665,11 +1665,8 @@ bool InitScriptExecutionCache(int64_t max_size_bytes)
// just write our 32-byte entropy twice to fill the 64 bytes.
g_scriptExecutionCacheHasher.Write(nonce.begin(), 32);
g_scriptExecutionCacheHasher.Write(nonce.begin(), 32);
- // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
- // setup_bytes creates the minimum possible cache (2 elements).
- size_t nMaxCacheSize = std::max<int64_t>(max_size_bytes, 0);
- auto setup_results = g_scriptExecutionCache.setup_bytes(nMaxCacheSize);
+ auto setup_results = g_scriptExecutionCache.setup_bytes(max_size_bytes);
if (!setup_results) return false;
const auto [num_elems, approx_size_bytes] = *setup_results;