Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigcache.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
* in CachingTransactionSignatureChecker::VerifySignature. We initialize | * in CachingTransactionSignatureChecker::VerifySignature. We initialize | ||||
* signatureCache outside of VerifySignature to avoid the atomic operation per | * signatureCache outside of VerifySignature to avoid the atomic operation per | ||||
* call overhead associated with local static variables even though | * call overhead associated with local static variables even though | ||||
* signatureCache could be made local to VerifySignature. | * signatureCache could be made local to VerifySignature. | ||||
*/ | */ | ||||
static CSignatureCache signatureCache; | static CSignatureCache signatureCache; | ||||
} // namespace | } // namespace | ||||
// To be called once in AppInit2/TestingSetup to initialize the signatureCache | // To be called once in AppInitMain/BasicTestingSetup to initialize the | ||||
// signatureCache. | |||||
void InitSignatureCache() { | void InitSignatureCache() { | ||||
// nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, | // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, | ||||
// setup_bytes creates the minimum possible cache (2 elements). | // setup_bytes creates the minimum possible cache (2 elements). | ||||
size_t nMaxCacheSize = | size_t nMaxCacheSize = | ||||
std::min(std::max(int64_t(0), gArgs.GetArg("-maxsigcachesize", | std::min(std::max(int64_t(0), gArgs.GetArg("-maxsigcachesize", | ||||
DEFAULT_MAX_SIG_CACHE_SIZE)), | DEFAULT_MAX_SIG_CACHE_SIZE)), | ||||
MAX_MAX_SIG_CACHE_SIZE) * | MAX_MAX_SIG_CACHE_SIZE) * | ||||
(size_t(1) << 20); | (size_t(1) << 20); | ||||
Show All 39 Lines |