mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 19:06:10 +02:00
index: Avoid async shutdown on init error
This commit is contained in:
@@ -98,9 +98,7 @@ bool BaseIndex::Init()
|
||||
}
|
||||
}
|
||||
if (prune_violation) {
|
||||
// throw error and graceful shutdown if we can't build the index
|
||||
FatalError("%s: %s best block of the index goes beyond pruned data. Please disable the index or reindex (which will download the whole blockchain again)", __func__, GetName());
|
||||
return false;
|
||||
return InitError(strprintf(Untranslated("%s best block of the index goes beyond pruned data. Please disable the index or reindex (which will download the whole blockchain again)"), GetName()));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -339,17 +337,17 @@ void BaseIndex::Interrupt()
|
||||
m_interrupt();
|
||||
}
|
||||
|
||||
void BaseIndex::Start()
|
||||
bool BaseIndex::Start()
|
||||
{
|
||||
// Need to register this ValidationInterface before running Init(), so that
|
||||
// callbacks are not missed if Init sets m_synced to true.
|
||||
RegisterValidationInterface(this);
|
||||
if (!Init()) {
|
||||
FatalError("%s: %s failed to initialize", __func__, GetName());
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_thread_sync = std::thread(&util::TraceThread, GetName(), [this] { ThreadSync(); });
|
||||
return true;
|
||||
}
|
||||
|
||||
void BaseIndex::Stop()
|
||||
|
||||
Reference in New Issue
Block a user