aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2024-05-20 22:32:32 +0200
committerTheCharlatan <seb.kung@gmail.com>2024-07-04 22:35:29 +0200
commitab14d1d6a4a8ef5fe5013150e6c5ebcb5f5e4ea9 (patch)
tree883717aa5d4afee50ba779e0c547e9fc483f7bcb /src/validation.cpp
parentd2c8d161b46bd62256a17abd086d8ae138c043c3 (diff)
validation: Don't error if maxsigcachesize exceeds uint32::max
Instead clamp it to uint32::max if it exceeds it. Co-authored-by: Anthony Towns <aj@erisian.com.au>
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 3e9ba08bb1..a9d26daf99 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2100,10 +2100,7 @@ bool InitScriptExecutionCache(size_t max_size_bytes)
g_scriptExecutionCacheHasher.Write(nonce.begin(), 32);
g_scriptExecutionCacheHasher.Write(nonce.begin(), 32);
- auto setup_results = g_scriptExecutionCache.setup_bytes(max_size_bytes);
- if (!setup_results) return false;
-
- const auto [num_elems, approx_size_bytes] = *setup_results;
+ const auto [num_elems, approx_size_bytes] = g_scriptExecutionCache.setup_bytes(max_size_bytes);
LogPrintf("Using %zu MiB out of %zu MiB requested for script execution cache, able to store %zu elements\n",
approx_size_bytes >> 20, max_size_bytes >> 20, num_elems);
return true;