MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / InitScriptExecutionCache

Function InitScriptExecutionCache

src/validation.cpp:1397–1404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1395static uint256 scriptExecutionCacheNonce(GetRandHash());
1396
1397void 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)

Callers 4

AppInitMainFunction · 0.85
BOOST_FIXTURE_TEST_CASEFunction · 0.85
BasicTestingSetupMethod · 0.85
AssembleBlockFunction · 0.85

Calls 3

maxFunction · 0.85
GetArgMethod · 0.45
setup_bytesMethod · 0.45

Tested by 2

BOOST_FIXTURE_TEST_CASEFunction · 0.68
BasicTestingSetupMethod · 0.68