rpc: Make unloadwallet wait for complete wallet unload

This commit is contained in:
João Barbosa
2018-12-12 23:21:19 +00:00
parent e7b88ecbc9
commit c37851de57
5 changed files with 56 additions and 12 deletions

View File

@@ -242,7 +242,11 @@ void StopWallets()
void UnloadWallets()
{
for (const std::shared_ptr<CWallet>& pwallet : GetWallets()) {
RemoveWallet(pwallet);
auto wallets = GetWallets();
while (!wallets.empty()) {
auto wallet = wallets.back();
wallets.pop_back();
RemoveWallet(wallet);
UnloadWallet(std::move(wallet));
}
}