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

Function InitSignatureCache

src/script/sigcache.cpp:118–126  ·  view source on GitHub ↗

To be called once in AppInitMain/BasicTestingSetup to initialize the signatureCache.

Source from the content-addressed store, hash-verified

116// To be called once in AppInitMain/BasicTestingSetup to initialize the
117// signatureCache.
118void InitSignatureCache()
119{
120 // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
121 // setup_bytes creates the minimum possible cache (2 elements).
122 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);
123 size_t nElems = signatureCache.setup_bytes(nMaxCacheSize);
124 LogPrintf("Using %zu MiB out of %zu/4 requested for signature cache, able to store %zu elements\n",
125 (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);
126}
127
128bool CachingTransactionSignatureChecker::VerifyECDSASignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const
129{

Callers 4

AppInitMainFunction · 0.85
initialize_simplicity_txFunction · 0.85
BasicTestingSetupMethod · 0.85

Calls 2

GetIntArgMethod · 0.80
setup_bytesMethod · 0.45

Tested by 3

initialize_simplicity_txFunction · 0.68
BasicTestingSetupMethod · 0.68