aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-28 14:01:37 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-12 10:47:35 +0200
commitfaad68fcd440e77e61a5a1560471417dd984e390 (patch)
tree0e6783601ce151ae81ff78ae7fe2a32768862d9e /src/init.cpp
parent2e30e328a7a46e0405664fd0cb31d971171f71d1 (diff)
downloadbitcoin-faad68fcd440e77e61a5a1560471417dd984e390.tar.xz
index: Avoid async shutdown on init error
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 481c3c7d63..89e152e56f 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1550,17 +1550,23 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// ********************************************************* Step 8: start indexers
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
g_txindex = std::make_unique<TxIndex>(nTxIndexCache, false, fReindex);
- g_txindex->Start();
+ if (!g_txindex->Start()) {
+ return false;
+ }
}
for (const auto& filter_type : g_enabled_filter_types) {
InitBlockFilterIndex(filter_type, filter_index_cache, false, fReindex);
- GetBlockFilterIndex(filter_type)->Start();
+ if (!GetBlockFilterIndex(filter_type)->Start()) {
+ return false;
+ }
}
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) {
g_coin_stats_index = std::make_unique<CoinStatsIndex>(/* cache size */ 0, false, fReindex);
- g_coin_stats_index->Start();
+ if (!g_coin_stats_index->Start()) {
+ return false;
+ }
}
// ********************************************************* Step 9: load wallet