mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 21:52:38 +01:00
validation: Don't error if maxsigcachesize exceeds uint32::max
Instead clamp it to uint32::max if it exceeds it. Co-authored-by: Anthony Towns <aj@erisian.com.au>
This commit is contained in:
@@ -1156,11 +1156,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
|
||||
ValidationCacheSizes validation_cache_sizes{};
|
||||
ApplyArgsManOptions(args, validation_cache_sizes);
|
||||
if (!InitSignatureCache(validation_cache_sizes.signature_cache_bytes)
|
||||
|| !InitScriptExecutionCache(validation_cache_sizes.script_execution_cache_bytes))
|
||||
{
|
||||
return InitError(strprintf(_("Unable to allocate memory for -maxsigcachesize: '%s' MiB"), args.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_BYTES >> 20)));
|
||||
}
|
||||
(void)InitSignatureCache(validation_cache_sizes.signature_cache_bytes);
|
||||
(void)InitScriptExecutionCache(validation_cache_sizes.script_execution_cache_bytes);
|
||||
|
||||
assert(!node.scheduler);
|
||||
node.scheduler = std::make_unique<CScheduler>();
|
||||
|
||||
Reference in New Issue
Block a user