To be called once in AppInit2/TestingSetup to initialize the rangeproof cache
| 153 | |
| 154 | // To be called once in AppInit2/TestingSetup to initialize the rangeproof cache |
| 155 | void InitRangeproofCache() |
| 156 | { |
| 157 | // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, |
| 158 | // setup_bytes creates the minimum possible cache (2 elements). |
| 159 | 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); |
| 160 | size_t nElems = rangeProofCache.setup_bytes(nMaxCacheSize); |
| 161 | LogPrintf("Using %zu MiB out of %zu/4 requested for rangeproof cache, able to store %zu elements\n", |
| 162 | (nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems); |
| 163 | } |
| 164 | |
| 165 | // To be called once in AppInit2/TestingSetup to initialize the surjectionrproof cache |
| 166 | void InitSurjectionproofCache() |