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

Function InitSurjectionproofCache

src/script/sigcache.cpp:166–174  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

164
165// To be called once in AppInit2/TestingSetup to initialize the surjectionrproof cache
166void InitSurjectionproofCache()
167{
168 // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
169 // setup_bytes creates the minimum possible cache (2 elements).
170 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);
171 size_t nElems = surjectionProofCache.setup_bytes(nMaxCacheSize);
172 LogPrintf("Using %zu MiB out of %zu/4 requested for surjectionproof cache, able to store %zu elements\n",
173 (nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems);
174}
175
176bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>& vchRangeProof, const std::vector<unsigned char>& vchValueCommitment, const std::vector<unsigned char>& vchAssetCommitment, const CScript& scriptPubKey, const secp256k1_context* secp256k1_ctx_verify_amounts) const
177{

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