To be called once in AppInitMain/BasicTestingSetup to initialize the signatureCache.
| 107 | // To be called once in AppInitMain/BasicTestingSetup to initialize the |
| 108 | // signatureCache. |
| 109 | void 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 | |
| 119 | bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash, uint32_t flags) const |
| 120 | { |
no test coverage detected