MCPcopy Create free account
hub / github.com/ElementsProject/elements / InitRangeproofCache

Function InitRangeproofCache

src/script/sigcache.cpp:155–163  ·  view source on GitHub ↗

To be called once in AppInit2/TestingSetup to initialize the rangeproof cache

Source from the content-addressed store, hash-verified

153
154// To be called once in AppInit2/TestingSetup to initialize the rangeproof cache
155void InitRangeproofCache()
156{
157 // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
158 // setup_bytes creates the minimum possible cache (2 elements).
159 size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 4), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
160 size_t nElems = rangeProofCache.setup_bytes(nMaxCacheSize);
161 LogPrintf("Using %zu MiB out of %zu/4 requested for rangeproof cache, able to store %zu elements\n",
162 (nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems);
163}
164
165// To be called once in AppInit2/TestingSetup to initialize the surjectionrproof cache
166void InitSurjectionproofCache()

Callers 3

AppInitMainFunction · 0.85
initialize_simplicity_txFunction · 0.85
BasicTestingSetupMethod · 0.85

Calls 2

GetIntArgMethod · 0.80
setup_bytesMethod · 0.45

Tested by 2

initialize_simplicity_txFunction · 0.68
BasicTestingSetupMethod · 0.68