From ab14d1d6a4a8ef5fe5013150e6c5ebcb5f5e4ea9 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Mon, 20 May 2024 22:32:32 +0200 Subject: validation: Don't error if maxsigcachesize exceeds uint32::max Instead clamp it to uint32::max if it exceeds it. Co-authored-by: Anthony Towns --- src/validation.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/validation.cpp') 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; -- cgit v1.2.3