diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index 7cee55a431..43b594f3cb 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -96,7 +96,7 @@ bool InitSignatureCache() { // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, // setup_bytes creates the minimum possible cache (2 elements). - size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20); + size_t nMaxCacheSize = std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2) * ((size_t) 1 << 20); auto setup_results = signatureCache.setup_bytes(nMaxCacheSize); diff --git a/src/script/sigcache.h b/src/script/sigcache.h index edcba2543c..0e3f900acf 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -16,8 +16,6 @@ // systems). Due to how we count cache size, actual memory usage is slightly // more (~32.25 MB) static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 32; -// Maximum sig cache size allowed -static const int64_t MAX_MAX_SIG_CACHE_SIZE = 16384; class CPubKey; diff --git a/src/validation.cpp b/src/validation.cpp index d0c84ba317..4d174a4b16 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1666,7 +1666,7 @@ bool InitScriptExecutionCache() { 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::min(std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20); + size_t nMaxCacheSize = std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2) * ((size_t) 1 << 20); auto setup_results = g_scriptExecutionCache.setup_bytes(nMaxCacheSize);