mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
validationcaches: Use size_t for sizes
...also move the 0-clamping logic to ApplyArgsManOptions, where it belongs.
This commit is contained in:
parent
41c5201a90
commit
0f3a2532c3
7 changed files with 20 additions and 21 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue