Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864830
D11646.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D11646.id.diff
View Options
diff --git a/src/init.cpp b/src/init.cpp
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -2679,8 +2679,10 @@
// If the loaded chain has a wrong genesis, bail out immediately
// (we're likely using a testnet datadir, or the other way
// around).
+ assert(std::addressof(g_chainman.m_blockman) ==
+ std::addressof(chainman.m_blockman));
if (!chainman.BlockIndex().empty() &&
- !g_chainman.m_blockman.LookupBlockIndex(
+ !chainman.m_blockman.LookupBlockIndex(
params.hashGenesisBlock)) {
return InitError(_("Incorrect or no genesis block found. "
"Wrong datadir for network?"));
@@ -2703,8 +2705,8 @@
// disk).
// This is called again in ThreadImport after the reindex
// completes.
- if (!fReindex &&
- !::ChainstateActive().LoadGenesisBlock(chainparams)) {
+ if (!fReindex && !chainman.ActiveChainstate().LoadGenesisBlock(
+ chainparams)) {
strLoadError = _("Error initializing block database");
break;
}
@@ -2865,18 +2867,18 @@
// Step 8: load indexers
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
g_txindex = std::make_unique<TxIndex>(nTxIndexCache, false, fReindex);
- g_txindex->Start(::ChainstateActive());
+ g_txindex->Start(chainman.ActiveChainstate());
}
for (const auto &filter_type : g_enabled_filter_types) {
InitBlockFilterIndex(filter_type, filter_index_cache, false, fReindex);
- GetBlockFilterIndex(filter_type)->Start(::ChainstateActive());
+ GetBlockFilterIndex(filter_type)->Start(chainman.ActiveChainstate());
}
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) {
g_coin_stats_index = std::make_unique<CoinStatsIndex>(
/* cache size */ 0, false, fReindex);
- g_coin_stats_index->Start(::ChainstateActive());
+ g_coin_stats_index->Start(chainman.ActiveChainstate());
}
// Step 9: load wallet
for (const auto &client : node.chain_clients) {
@@ -2918,7 +2920,9 @@
// fHaveGenesis directly.
// No locking, as this happens before any background thread is started.
boost::signals2::connection block_notify_genesis_wait_connection;
- if (::ChainActive().Tip() == nullptr) {
+ assert(std::addressof(::ChainActive()) ==
+ std::addressof(chainman.ActiveChain()));
+ if (chainman.ActiveTip() == nullptr) {
block_notify_genesis_wait_connection =
uiInterface.NotifyBlockTip_connect(
std::bind(BlockNotifyGenesisWait, std::placeholders::_2));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 22:40 (4 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5861498
Default Alt Text
D11646.id.diff (2 KB)
Attached To
D11646: init: Use existing chainman
Event Timeline
Log In to Comment