Skip to content

Commit 0dd6a8c

Browse files
committed
Check m_internals in UnregisterValidationInterface
When a wallet is created it is registered in the validation interface (in CWallet::CreateWalletFromFile) but it is not immediately added to the wallets list. If a shutdown is requested before AddWallet (case more evident when -rescan is set) then m_internals can be released (in Shutdown -> UnregisterBackgroundSignalScheduler) before the wallet and then ReleaseWallet would call UnregisterValidationInterface with m_internals already released.
1 parent fd6d499 commit 0dd6a8c

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
@@ -107,7 +107,9 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) {
107107
}
108108

109109
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
110-
g_signals.m_internals->m_connMainSignals.erase(pwalletIn);
110+
if (g_signals.m_internals) {
111+
g_signals.m_internals->m_connMainSignals.erase(pwalletIn);
112+
}
111113
}
112114

113115
void UnregisterAllValidationInterfaces() {

0 commit comments

Comments
 (0)