mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge bitcoin/bitcoin#25704: refactor: Remove almost all validation option globals
aaaa7bd0baiwyu: Add missing includes (MacroFake)fa9ebec096Remove g_parallel_script_checks (MacroFake)fa7c834b9fMove ::fCheckBlockIndex into ChainstateManager (MacroFake)fa43188d86Move ::fCheckpointsEnabled into ChainstateManager (MacroFake)cccca83099Move ::nMinimumChainWork into ChainstateManager (MacroFake)fa29d0b57cMove ::hashAssumeValid into ChainstateManager (MacroFake)faf44876dbMove ::nMaxTipAge into ChainstateManager (MacroFake) Pull request description: It seems preferable to assign globals to a class (in this case `ChainstateManager`), than to leave them dangling. This should clarify scope for code-readers, as well as clarifying unit test behaviour. ACKs for top commit: dergoegge: Code review ACKaaaa7bd0baryanofsky: Code review ACKaaaa7bd0ba. No changes since last review, other than rebase aureleoules: reACKaaaa7bd0baTree-SHA512: 83ec3ba0fb4f1dad95810d4bd4e578454e0718dc1bdd3a794cc4e48aa819b6f5dad4ac4edab3719bdfd5f89cbe23c2740a50fd56c1ff81c99e521c5f6d4e898d
This commit is contained in:
@@ -146,7 +146,6 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve
|
||||
Assert(InitScriptExecutionCache(validation_cache_sizes.script_execution_cache_bytes));
|
||||
|
||||
m_node.chain = interfaces::MakeChain(m_node);
|
||||
fCheckBlockIndex = true;
|
||||
static bool noui_connected = false;
|
||||
if (!noui_connected) {
|
||||
noui_connect();
|
||||
@@ -181,14 +180,13 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
|
||||
const ChainstateManager::Options chainman_opts{
|
||||
.chainparams = chainparams,
|
||||
.adjusted_time_callback = GetAdjustedTime,
|
||||
.check_block_index = true,
|
||||
};
|
||||
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts);
|
||||
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true);
|
||||
|
||||
// Start script-checking threads. Set g_parallel_script_checks to true so they are used.
|
||||
constexpr int script_check_threads = 2;
|
||||
StartScriptCheckWorkerThreads(script_check_threads);
|
||||
g_parallel_script_checks = true;
|
||||
}
|
||||
|
||||
ChainTestingSetup::~ChainTestingSetup()
|
||||
|
||||
Reference in New Issue
Block a user