From da10e65cff7afeca1b8cd2e40da0a9b39f9be6a3 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 25 Mar 2020 18:30:06 +0100 Subject: [PATCH] Call FlushBackgroundCallbacks before resetting CConnman --- src/init.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 733839582c0b..0094cfdd8823 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -254,6 +254,10 @@ void PrepareShutdown() threadGroup.interrupt_all(); threadGroup.join_all(); + // After there are no more peers/RPC left to give us new data which may generate + // CValidationInterface callbacks, flush them... + GetMainSignals().FlushBackgroundCallbacks(); + if (!fLiteMode && !fRPCInWarmup) { // STORE DATA CACHES INTO SERIALIZED DAT FILES CFlatDB flatdb1("mncache.dat", "magicMasternodeCache"); @@ -293,10 +297,6 @@ 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