| 2030 | } |
| 2031 | |
| 2032 | ValidationCache::ValidationCache(const size_t script_execution_cache_bytes, const size_t signature_cache_bytes) |
| 2033 | : m_signature_cache{signature_cache_bytes} |
| 2034 | { |
| 2035 | // Setup the salted hasher |
| 2036 | uint256 nonce = GetRandHash(); |
| 2037 | // We want the nonce to be 64 bytes long to force the hasher to process |
| 2038 | // this chunk, which makes later hash computations more efficient. We |
| 2039 | // just write our 32-byte entropy twice to fill the 64 bytes. |
| 2040 | m_script_execution_cache_hasher.Write(nonce.begin(), 32); |
| 2041 | m_script_execution_cache_hasher.Write(nonce.begin(), 32); |
| 2042 | |
| 2043 | const auto [num_elems, approx_size_bytes] = m_script_execution_cache.setup_bytes(script_execution_cache_bytes); |
| 2044 | LogInfo("Using %zu MiB out of %zu MiB requested for script execution cache, able to store %zu elements", |
| 2045 | approx_size_bytes >> 20, script_execution_cache_bytes >> 20, num_elems); |
| 2046 | } |
| 2047 | |
| 2048 | /** |
| 2049 | * Check whether all of this transaction's input scripts succeed. |
nothing calls this directly
no test coverage detected