mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
refactor: Clamp worker threads in ChainstateManager constructor
This ensures the options are applied consistently from contexts where
they might not pass through the args manager, such as in some tests, or
when used through the kernel library.
This is similar to the patch applied in 09ef322acc.
This commit is contained in:
parent
e546b4e1a0
commit
8f85d36d68
5 changed files with 7 additions and 5 deletions
|
|
@ -60,8 +60,7 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& args, ChainstateManage
|
|||
script_threads += GetNumCores();
|
||||
}
|
||||
// Subtract 1 because the main thread counts towards the par threads.
|
||||
opts.worker_threads_num = std::clamp(script_threads - 1, 0, MAX_SCRIPTCHECK_THREADS);
|
||||
LogPrintf("Script verification uses %d additional threads\n", opts.worker_threads_num);
|
||||
opts.worker_threads_num = script_threads - 1;
|
||||
|
||||
if (auto max_size = args.GetIntArg("-maxsigcachesize")) {
|
||||
// 1. When supplied with a max_size of 0, both the signature cache and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue