mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-22 21:50:14 +01:00
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).
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user