File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -189,9 +189,7 @@ void Shutdown()
189189 StopRPC ();
190190 StopHTTPServer ();
191191#ifdef ENABLE_WALLET
192- for (CWalletRef pwallet : vpwallets) {
193- pwallet->Flush (false );
194- }
192+ FlushWallets (false );
195193#endif
196194 MapPort (false );
197195 UnregisterValidationInterface (peerLogic.get ());
@@ -246,9 +244,7 @@ void Shutdown()
246244 pblocktree = nullptr ;
247245 }
248246#ifdef ENABLE_WALLET
249- for (CWalletRef pwallet : vpwallets) {
250- pwallet->Flush (true );
251- }
247+ FlushWallets (true );
252248#endif
253249
254250#if ENABLE_ZMQ
Original file line number Diff line number Diff line change @@ -245,3 +245,9 @@ bool OpenWallets()
245245
246246 return true ;
247247}
248+
249+ void FlushWallets (bool shutdown) {
250+ for (CWalletRef pwallet : vpwallets) {
251+ pwallet->Flush (shutdown);
252+ }
253+ }
Original file line number Diff line number Diff line change @@ -22,4 +22,7 @@ bool VerifyWallets();
2222// ! Load wallet databases.
2323bool OpenWallets ();
2424
25+ // ! Flush all wallets in preparation for shutdown.
26+ // ! Call with shutdown = true to actually shutdown the wallet.
27+ void FlushWallets (bool shutdown);
2528#endif // BITCOIN_WALLET_INIT_H
You can’t perform that action at this time.
0 commit comments