mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-08 20:50:48 +02:00
wallet: WaitForDeleteWallet, do not expect thread safety
Multiple threads could try to delete the wallet at the same time.
This commit is contained in:
@@ -250,8 +250,9 @@ void WaitForDeleteWallet(std::shared_ptr<CWallet>&& wallet)
|
||||
const std::string name = wallet->GetName();
|
||||
{
|
||||
LOCK(g_wallet_release_mutex);
|
||||
auto it = g_unloading_wallet_set.insert(name);
|
||||
assert(it.second);
|
||||
g_unloading_wallet_set.insert(name);
|
||||
// Do not expect to be the only one removing this wallet.
|
||||
// Multiple threads could simultaneously be waiting for deletion.
|
||||
}
|
||||
|
||||
// Time to ditch our shared_ptr and wait for ReleaseWallet call.
|
||||
|
Reference in New Issue
Block a user