diff options
author | John Newbery <john@johnnewbery.com> | 2017-08-28 12:53:56 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-09-07 16:21:26 -0700 |
commit | 77fe07c1591395b4279f9f2ff3c36c6bde11fbb7 (patch) | |
tree | 340158d4f541bb9f4bbc7bbe1615ba1e1a2e66d2 /src | |
parent | 2da5eafa47cdf81107bd3e71a709d404ebb6dcdb (diff) |
[wallet] Add StopWallets() function to wallet/init.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 4 | ||||
-rw-r--r-- | src/wallet/init.cpp | 10 | ||||
-rw-r--r-- | src/wallet/init.h | 6 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp index 6d250a25cf..d1ffe126d4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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 diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index f58f3bc545..2b5c6b1737 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -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); } } diff --git a/src/wallet/init.h b/src/wallet/init.h index 5445c72d1c..c06b058474 100644 --- a/src/wallet/init.h +++ b/src/wallet/init.h @@ -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 |