| 1395 | static uint256 scriptExecutionCacheNonce(GetRandHash()); |
| 1396 | |
| 1397 | void InitScriptExecutionCache() { |
| 1398 | // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, |
| 1399 | // setup_bytes creates the minimum possible cache (2 elements). |
| 1400 | size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20); |
| 1401 | size_t nElems = scriptExecutionCache.setup_bytes(nMaxCacheSize); |
| 1402 | LogPrintf("Using %zu MiB out of %zu/2 requested for script execution cache, able to store %zu elements\n", |
| 1403 | (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems); |
| 1404 | } |
| 1405 | |
| 1406 | /** |
| 1407 | * Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts) |