Move global scriptcheckqueue into ChainstateManager class

This commit is contained in:
Hennadii Stepanov
2023-07-07 10:33:11 +01:00
parent 4e78834ec1
commit be4ff3060b
7 changed files with 38 additions and 42 deletions

View File

@@ -13,6 +13,7 @@
#include <arith_uint256.h>
#include <attributes.h>
#include <chain.h>
#include <checkqueue.h>
#include <kernel/chain.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
@@ -98,11 +99,6 @@ extern uint256 g_best_block;
/** Documentation for argument 'checklevel'. */
extern const std::vector<std::string> CHECKLEVEL_DOC;
/** Run instances of script checking worker threads */
void StartScriptCheckWorkerThreads(int threads_num);
/** Stop all of the script checking worker threads */
void StopScriptCheckWorkerThreads();
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams);
bool FatalError(kernel::Notifications& notifications, BlockValidationState& state, const std::string& strMessage, const bilingual_str& userMessage = {});
@@ -896,6 +892,9 @@ private:
return cs && !cs->m_disabled;
}
//! A queue for script verifications that have to be performed by worker threads.
CCheckQueue<CScriptCheck> m_script_check_queue;
public:
using Options = kernel::ChainstateManagerOpts;
@@ -1246,6 +1245,9 @@ public:
//! nullopt.
std::optional<int> GetSnapshotBaseHeight() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
CCheckQueue<CScriptCheck>& GetCheckQueue() { return m_script_check_queue; }
void StopScriptCheckWorkerThreads();
~ChainstateManager();
};