diff --git a/src/init.cpp b/src/init.cpp index 0ca7f67032..064c5d17e1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -307,6 +307,10 @@ void PrepareShutdown() FlushStateToDisk(); } + // After there are no more peers/RPC left to give us new data which may generate + // CValidationInterface callbacks, flush them... + GetMainSignals().FlushBackgroundCallbacks(); + // Any future callbacks will be dropped. This should absolutely be safe - if // missing a callback results in an unrecoverable situation, unclean shutdown // would too. The only reason to do the above flushes is to let the wallet catch