Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | |||||
void StopWallets() { | void StopWallets() { | ||||
for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | ||||
pwallet->Flush(true); | pwallet->Flush(true); | ||||
} | } | ||||
} | } | ||||
void UnloadWallets() { | void UnloadWallets() { | ||||
for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | auto wallets = GetWallets(); | ||||
RemoveWallet(pwallet); | while (!wallets.empty()) { | ||||
auto wallet = wallets.back(); | |||||
wallets.pop_back(); | |||||
RemoveWallet(wallet); | |||||
UnloadWallet(std::move(wallet)); | |||||
} | } | ||||
} | } |