diff options
author | Carl Dong <contact@carldong.me> | 2022-07-01 00:08:14 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-08-03 12:03:28 -0400 |
commit | 0f3a2532c38074dd9789d1c4c667db6ca46ff0ab (patch) | |
tree | e45ce50c4efda6ac38aa3dfeeb18dae4e2ecc8d0 /src/script/sigcache.cpp | |
parent | 41c5201a90bbc2893333e334e8945759ef24e7dd (diff) |
validationcaches: Use size_t for sizes
...also move the 0-clamping logic to ApplyArgsManOptions, where it
belongs.
Diffstat (limited to 'src/script/sigcache.cpp')
-rw-r--r-- | src/script/sigcache.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index 8e6971d3f3..e507ec7528 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -93,13 +93,9 @@ static CSignatureCache signatureCache; // To be called once in AppInitMain/BasicTestingSetup to initialize the // signatureCache. -bool InitSignatureCache(int64_t max_size_bytes) +bool InitSignatureCache(size_t max_size_bytes) { - // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, - // setup_bytes creates the minimum possible cache (2 elements). - size_t nMaxCacheSize = std::max<int64_t>(max_size_bytes, 0); - - auto setup_results = signatureCache.setup_bytes(nMaxCacheSize); + auto setup_results = signatureCache.setup_bytes(max_size_bytes); if (!setup_results) return false; const auto [num_elems, approx_size_bytes] = *setup_results; |