To be called once in AppInit2/TestingSetup to initialize the surjectionrproof cache
| 164 | |
| 165 | // To be called once in AppInit2/TestingSetup to initialize the surjectionrproof cache |
| 166 | void InitSurjectionproofCache() |
| 167 | { |
| 168 | // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, |
| 169 | // setup_bytes creates the minimum possible cache (2 elements). |
| 170 | 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); |
| 171 | size_t nElems = surjectionProofCache.setup_bytes(nMaxCacheSize); |
| 172 | LogPrintf("Using %zu MiB out of %zu/4 requested for surjectionproof cache, able to store %zu elements\n", |
| 173 | (nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems); |
| 174 | } |
| 175 | |
| 176 | bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>& vchRangeProof, const std::vector<unsigned char>& vchValueCommitment, const std::vector<unsigned char>& vchAssetCommitment, const CScript& scriptPubKey, const secp256k1_context* secp256k1_ctx_verify_amounts) const |
| 177 | { |