To be called once in AppInitMain/BasicTestingSetup to initialize the signatureCache.
| 71 | // To be called once in AppInitMain/BasicTestingSetup to initialize the |
| 72 | // signatureCache. |
| 73 | void 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 | |
| 83 | bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const |
| 84 | { |