diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-28 12:08:09 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-28 12:12:05 +0100 |
commit | d31e5c1d0f303a8cd97077d425488ed5abdf5345 (patch) | |
tree | d679abc9eab2edd8636df68df5a143fb35cf600f /src/validationinterface.cpp | |
parent | 26efc220a13aa3413f6e55e311e8991445104f82 (diff) |
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.
Diffstat (limited to 'src/validationinterface.cpp')
-rw-r--r-- | src/validationinterface.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 5ceba17e06..abbd8cc4d2 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -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(); |