MCPcopy Create free account
hub / github.com/LUX-Core/lux / InitSignatureCache

Function InitSignatureCache

src/script/sigcache.cpp:109–117  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

107// To be called once in AppInitMain/BasicTestingSetup to initialize the
108// signatureCache.
109void InitSignatureCache()
110{
111 // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
112 // setup_bytes creates the minimum possible cache (2 elements).
113 size_t nMaxCacheSize = std::min(std::max((int64_t)0, GetArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
114 size_t nElems = signatureCache.setup_bytes(nMaxCacheSize);
115 LogPrintf("Using %zu MiB out of %zu/2 requested for signature cache, able to store %zu elements\n",
116 (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);
117}
118
119bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash, uint32_t flags) const
120{

Callers 1

AppInit2Function · 0.85

Calls 3

maxFunction · 0.85
GetArgFunction · 0.85
setup_bytesMethod · 0.45

Tested by

no test coverage detected