mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Fix shutdown in case of errors during initialization
PR #10286 introduced a few steps which are not robust to early shutdown in initialization. Stumbled upon this with #11781, not sure if there are other scenarios that can trigger it, but it's harden against this in any case.
This commit is contained in:
@@ -49,7 +49,9 @@ void CMainSignals::UnregisterBackgroundSignalScheduler() {
|
||||
}
|
||||
|
||||
void CMainSignals::FlushBackgroundCallbacks() {
|
||||
m_internals->m_schedulerClient.EmptyQueue();
|
||||
if (m_internals) {
|
||||
m_internals->m_schedulerClient.EmptyQueue();
|
||||
}
|
||||
}
|
||||
|
||||
void CMainSignals::RegisterWithMempoolSignals(CTxMemPool& pool) {
|
||||
@@ -92,6 +94,9 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||
}
|
||||
|
||||
void UnregisterAllValidationInterfaces() {
|
||||
if (!g_signals.m_internals) {
|
||||
return;
|
||||
}
|
||||
g_signals.m_internals->BlockChecked.disconnect_all_slots();
|
||||
g_signals.m_internals->Broadcast.disconnect_all_slots();
|
||||
g_signals.m_internals->Inventory.disconnect_all_slots();
|
||||
|
||||
Reference in New Issue
Block a user