diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/sigcache.cpp | 8 | ||||
-rw-r--r-- | src/script/sigcache.h | 2 |
2 files changed, 3 insertions, 7 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; diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 4c1cad38a7..290955090d 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -32,6 +32,6 @@ public: bool VerifySchnorrSignature(Span<const unsigned char> sig, const XOnlyPubKey& pubkey, const uint256& sighash) const override; }; -[[nodiscard]] bool InitSignatureCache(int64_t max_size_bytes); +[[nodiscard]] bool InitSignatureCache(size_t max_size_bytes); #endif // BITCOIN_SCRIPT_SIGCACHE_H |