Skip to content

Commit 7343143

Browse files
laanwjfurszy
authored andcommitted
Fix shutdown in case of errors during initialization
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.
1 parent ee2c537 commit 7343143

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/validationinterface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ void CMainSignals::UnregisterBackgroundSignalScheduler() {
6767
}
6868

6969
void CMainSignals::FlushBackgroundCallbacks() {
70-
m_internals->m_schedulerClient.EmptyQueue();
70+
if (m_internals) {
71+
m_internals->m_schedulerClient.EmptyQueue();
72+
}
7173
}
7274

7375
CMainSignals& GetMainSignals()

0 commit comments

Comments
 (0)