[wallet] Add StopWallets() function to wallet/init.cpp

This commit is contained in:
John Newbery committed 2017-09-07 16:21:26 -07:00
1 parent 2da5eafa47
commit 77fe07c159
3 files changed
+14 -6

No files matched your search

+2 -2
View File
@@ -189,7 +189,7 @@ void Shutdown()
StopRPC();
StopHTTPServer();
#ifdef ENABLE_WALLET
FlushWallets(false);
FlushWallets();
#endif
MapPort(false);
UnregisterValidationInterface(peerLogic.get());
@@ -244,7 +244,7 @@ void Shutdown()
pblocktree = nullptr;
}
#ifdef ENABLE_WALLET
FlushWallets(true);
StopWallets();
#endif
#if ENABLE_ZMQ
+8 -2
View File
@@ -246,8 +246,14 @@ bool OpenWallets()
return true;
}
void FlushWallets(bool shutdown) {
void FlushWallets() {
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(shutdown);
pwallet->Flush(false);
}
}
void StopWallets() {
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(true);
}
}
+4 -2
View File
@@ -23,6 +23,8 @@ bool VerifyWallets();
bool OpenWallets();
//! Flush all wallets in preparation for shutdown.
//! Call with shutdown = true to actually shutdown the wallet.
void FlushWallets(bool shutdown);
void FlushWallets();
//! Stop all wallets. Wallets will be flushed first.
void StopWallets();
#endif // BITCOIN_WALLET_INIT_H