mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
validation: add -prevoutfetchthreads configuration option
Add a configuration option for the number of worker threads used for parallel UTXO prevout prefetching during block connection. Default is 8 threads, max is 16, 0 disables parallel fetching.
This commit is contained in:
@@ -60,6 +60,13 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& args, ChainstateManage
|
||||
// Subtract 1 because the main thread counts towards the par threads.
|
||||
opts.worker_threads_num = script_threads - 1;
|
||||
|
||||
if (auto value{args.GetArg<int32_t>("-prevoutfetchthreads")}) {
|
||||
if (*value < 0) {
|
||||
return util::Error{Untranslated(strprintf("-prevoutfetchthreads must be non-negative (got %d). Use 0 to disable parallel input fetching.", *value))};
|
||||
}
|
||||
opts.prevoutfetch_threads_num = std::min(*value, MAX_PREVOUTFETCH_THREADS);
|
||||
}
|
||||
|
||||
if (auto max_size = args.GetIntArg("-maxsigcachesize")) {
|
||||
// 1. When supplied with a max_size of 0, both the signature cache and
|
||||
// script execution cache create the minimum possible cache (2
|
||||
|
||||
Reference in New Issue
Block a user