Browse Source

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

0.16
John Newbery 7 years ago
parent
commit
77fe07c159
  1. 4
      src/init.cpp
  2. 10
      src/wallet/init.cpp
  3. 6
      src/wallet/init.h

4
src/init.cpp

@ -189,7 +189,7 @@ void Shutdown() @@ -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() @@ -244,7 +244,7 @@ void Shutdown()
pblocktree = nullptr;
}
#ifdef ENABLE_WALLET
FlushWallets(true);
StopWallets();
#endif
#if ENABLE_ZMQ

10
src/wallet/init.cpp

@ -246,8 +246,14 @@ bool OpenWallets() @@ -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);
}
}

6
src/wallet/init.h

@ -23,6 +23,8 @@ bool VerifyWallets(); @@ -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

Loading…
Cancel
Save