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

Function InitSignatureCache

src/script/sigcache.cpp:73–81  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

71// To be called once in AppInitMain/BasicTestingSetup to initialize the
72// signatureCache.
73void InitSignatureCache()
74{
75 // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
76 // setup_bytes creates the minimum possible cache (2 elements).
77 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);
78 size_t nElems = signatureCache.setup_bytes(nMaxCacheSize);
79 LogPrintf("Using %zu MiB out of %zu/2 requested for signature cache, able to store %zu elements\n",
80 (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);
81}
82
83bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const
84{

Callers 2

AppInitMainFunction · 0.85
BasicTestingSetupMethod · 0.85

Calls 3

maxFunction · 0.85
GetArgMethod · 0.45
setup_bytesMethod · 0.45

Tested by 1

BasicTestingSetupMethod · 0.68