From 062d63102eb1e90168d28589de8bf182e9a6a7d3 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 28 Aug 2017 12:41:33 -0400 Subject: [PATCH] [wallet] Add CloseWallets() function to wallet/init.cpp --- src/init.cpp | 5 +---- src/wallet/init.cpp | 7 +++++++ src/wallet/init.h | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index d1ffe126d..3f528a1f5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -265,10 +265,7 @@ void Shutdown() UnregisterAllValidationInterfaces(); GetMainSignals().UnregisterBackgroundSignalScheduler(); #ifdef ENABLE_WALLET - for (CWalletRef pwallet : vpwallets) { - delete pwallet; - } - vpwallets.clear(); + CloseWallets(); #endif globalVerifyHandle.reset(); ECC_Stop(); diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 2b5c6b173..84318eac0 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -257,3 +257,10 @@ void StopWallets() { pwallet->Flush(true); } } + +void CloseWallets() { + for (CWalletRef pwallet : vpwallets) { + delete pwallet; + } + vpwallets.clear(); +} diff --git a/src/wallet/init.h b/src/wallet/init.h index c06b05847..1be2ef927 100644 --- a/src/wallet/init.h +++ b/src/wallet/init.h @@ -27,4 +27,8 @@ void FlushWallets(); //! Stop all wallets. Wallets will be flushed first. void StopWallets(); + +//! Close all wallets. +void CloseWallets(); + #endif // BITCOIN_WALLET_INIT_H