Browse Source

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

0.16
John Newbery 7 years ago
parent
commit
2da5eafa47
  1. 8
      src/init.cpp
  2. 6
      src/wallet/init.cpp
  3. 3
      src/wallet/init.h

8
src/init.cpp

@ -189,9 +189,7 @@ void Shutdown() @@ -189,9 +189,7 @@ void Shutdown()
StopRPC();
StopHTTPServer();
#ifdef ENABLE_WALLET
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(false);
}
FlushWallets(false);
#endif
MapPort(false);
UnregisterValidationInterface(peerLogic.get());
@ -246,9 +244,7 @@ void Shutdown() @@ -246,9 +244,7 @@ void Shutdown()
pblocktree = nullptr;
}
#ifdef ENABLE_WALLET
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(true);
}
FlushWallets(true);
#endif
#if ENABLE_ZMQ

6
src/wallet/init.cpp

@ -245,3 +245,9 @@ bool OpenWallets() @@ -245,3 +245,9 @@ bool OpenWallets()
return true;
}
void FlushWallets(bool shutdown) {
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(shutdown);
}
}

3
src/wallet/init.h

@ -22,4 +22,7 @@ bool VerifyWallets(); @@ -22,4 +22,7 @@ bool VerifyWallets();
//! Load wallet databases.
bool OpenWallets();
//! Flush all wallets in preparation for shutdown.
//! Call with shutdown = true to actually shutdown the wallet.
void FlushWallets(bool shutdown);
#endif // BITCOIN_WALLET_INIT_H

Loading…
Cancel
Save