aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/init.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-04-17 18:22:23 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-04-18 22:07:33 +0100
commit373aee26c3df233f4e0a7e806f45ac7cb5aab1e6 (patch)
tree9594af3ef3b909ff0c70bb73917785b460308d67 /src/wallet/init.cpp
parent6efd9644cfe31168db1841010cffa64dfe604e67 (diff)
downloadbitcoin-373aee26c3df233f4e0a7e806f45ac7cb5aab1e6.tar.xz
wallet: Add AddWallet, RemoveWallet, GetWallet and GetWallets
With these new functions all vpwallets usage are removed and vpwallets is now a static variable (no external linkage).
Diffstat (limited to 'src/wallet/init.cpp')
-rw-r--r--src/wallet/init.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 860e1cfac3..8b834e4626 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -315,7 +315,7 @@ bool WalletInit::Open() const
if (!pwallet) {
return false;
}
- vpwallets.push_back(pwallet);
+ AddWallet(pwallet);
}
return true;
@@ -323,29 +323,29 @@ bool WalletInit::Open() const
void WalletInit::Start(CScheduler& scheduler) const
{
- for (CWallet* pwallet : vpwallets) {
+ for (CWallet* pwallet : GetWallets()) {
pwallet->postInitProcess(scheduler);
}
}
void WalletInit::Flush() const
{
- for (CWallet* pwallet : vpwallets) {
+ for (CWallet* pwallet : GetWallets()) {
pwallet->Flush(false);
}
}
void WalletInit::Stop() const
{
- for (CWallet* pwallet : vpwallets) {
+ for (CWallet* pwallet : GetWallets()) {
pwallet->Flush(true);
}
}
void WalletInit::Close() const
{
- for (CWallet* pwallet : vpwallets) {
+ for (CWallet* pwallet : GetWallets()) {
+ RemoveWallet(pwallet);
delete pwallet;
}
- vpwallets.clear();
}