mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Merge bitcoin/bitcoin#31313: refactor: Clamp worker threads in ChainstateManager constructor
8f85d36d68refactor: Clamp worker threads in ChainstateManager constructor (TheCharlatan) Pull request description: 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 in09ef322acc, used to make applying the mempool options consistent. --- This is part of the libbitcoinkernel project https://github.com/bitcoin/bitcoin/issues/27587 ACKs for top commit: maflcko: ACK8f85d36d68🛳 achow101: ACK8f85d36d68furszy: Code ACK8f85d36d68stickies-v: ACK8f85d36d68Tree-SHA512: 32d7cc177d6726ee9df62ac9eb43e49ba676f35bfcff47834bd97a1e33f2a9ea7be65d0a8a37be149de04e58c9c500ecef730e498f4e3909042324d3136160e9
This commit is contained in:
@@ -6294,7 +6294,7 @@ static ChainstateManager::Options&& Flatten(ChainstateManager::Options&& opts)
|
||||
}
|
||||
|
||||
ChainstateManager::ChainstateManager(const util::SignalInterrupt& interrupt, Options options, node::BlockManager::Options blockman_options)
|
||||
: m_script_check_queue{/*batch_size=*/128, options.worker_threads_num},
|
||||
: m_script_check_queue{/*batch_size=*/128, std::clamp(options.worker_threads_num, 0, MAX_SCRIPTCHECK_THREADS)},
|
||||
m_interrupt{interrupt},
|
||||
m_options{Flatten(std::move(options))},
|
||||
m_blockman{interrupt, std::move(blockman_options)},
|
||||
|
||||
Reference in New Issue
Block a user