To be called once in AppInitMain/BasicTestingSetup to initialize the signatureCache.
| 116 | // To be called once in AppInitMain/BasicTestingSetup to initialize the |
| 117 | // signatureCache. |
| 118 | void 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 | |
| 128 | bool CachingTransactionSignatureChecker::VerifyECDSASignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const |
| 129 | { |