mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge bitcoin/bitcoin#26762: bugfix: Make CCheckQueue RAII-styled (attempt 2)
5b3ea5fa2erefactor: Move `{MAX,DEFAULT}_SCRIPTCHECK_THREADS` constants (Hennadii Stepanov)6e17b31680refactor: Make `CCheckQueue` non-copyable and non-movable explicitly (Hennadii Stepanov)8111e74653refactor: Drop unneeded declaration (Hennadii Stepanov)9cf89f7a5brefactor: Make `CCheckQueue` constructor start worker threads (Hennadii Stepanov)d03eaacbcfMake `CCheckQueue` destructor stop worker threads (Hennadii Stepanov)be4ff3060bMove global `scriptcheckqueue` into `ChainstateManager` class (Hennadii Stepanov) Pull request description: This PR: - makes `CCheckQueue` RAII-styled - gets rid of the global `scriptcheckqueue` - fixes https://github.com/bitcoin/bitcoin/issues/25448 The previous attempt was in https://github.com/bitcoin/bitcoin/pull/18731. ACKs for top commit: martinus: ACK5b3ea5fa2eachow101: ACK5b3ea5fa2eTheCharlatan: ACK5b3ea5fa2eTree-SHA512: 45cca846e7ed107e3930149f0b616ddbaf2648d6cde381f815331b861b5d67ab39e154883ae174b8abb1dae485bc904318c50c51e5d6b46923d89de51c5eadb0
This commit is contained in:
@@ -187,6 +187,7 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
|
||||
.adjusted_time_callback = GetAdjustedTime,
|
||||
.check_block_index = true,
|
||||
.notifications = *m_node.notifications,
|
||||
.worker_threads_num = 2,
|
||||
};
|
||||
const BlockManager::Options blockman_opts{
|
||||
.chainparams = chainman_opts.chainparams,
|
||||
@@ -198,15 +199,11 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
|
||||
.path = m_args.GetDataDirNet() / "blocks" / "index",
|
||||
.cache_bytes = static_cast<size_t>(m_cache_sizes.block_tree_db),
|
||||
.memory_only = true});
|
||||
|
||||
constexpr int script_check_threads = 2;
|
||||
StartScriptCheckWorkerThreads(script_check_threads);
|
||||
}
|
||||
|
||||
ChainTestingSetup::~ChainTestingSetup()
|
||||
{
|
||||
if (m_node.scheduler) m_node.scheduler->stop();
|
||||
StopScriptCheckWorkerThreads();
|
||||
GetMainSignals().FlushBackgroundCallbacks();
|
||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||
m_node.connman.reset();
|
||||
|
||||
Reference in New Issue
Block a user