aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-08-28 12:41:33 -0400
committerJohn Newbery <john@johnnewbery.com>2017-09-07 16:21:26 -0700
commit062d63102eb1e90168d28589de8bf182e9a6a7d3 (patch)
treeb0550b5a12daf40f065b21a4c6ddb0dd7619936a /src/wallet
parent77fe07c1591395b4279f9f2ff3c36c6bde11fbb7 (diff)
downloadbitcoin-062d63102eb1e90168d28589de8bf182e9a6a7d3.tar.xz
[wallet] Add CloseWallets() function to wallet/init.cpp
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/init.cpp7
-rw-r--r--src/wallet/init.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 2b5c6b1737..84318eac0a 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 c06b058474..1be2ef9273 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