Skip to content

Commit

Permalink
Fix shutdown in case of errors during initialization
Browse files Browse the repository at this point in the history
PR bitcoin#10286 introduced a few steps which are not robust to early shutdown
in initialization.

Stumbled upon this with bitcoin#11781, not sure if there are other scenarios
that can trigger it, but it's harden against this in any case.
  • Loading branch information
laanwj authored and furszy committed Feb 7, 2021
1 parent 8bee831 commit e7e9d43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/validationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ void CMainSignals::UnregisterBackgroundSignalScheduler() {
}

void CMainSignals::FlushBackgroundCallbacks() {
m_internals->m_schedulerClient.EmptyQueue();
if (m_internals) {
m_internals->m_schedulerClient.EmptyQueue();
}
}

CMainSignals& GetMainSignals()
Expand Down

0 comments on commit e7e9d43

Please sign in to comment.