mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03: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:
parent
8872b4a6ca
commit
64e736d79e
1 changed files with 3 additions and 2 deletions
|
@ -250,8 +250,9 @@ void WaitForDeleteWallet(std::shared_ptr<CWallet>&& wallet)
|
||||||
const std::string name = wallet->GetName();
|
const std::string name = wallet->GetName();
|
||||||
{
|
{
|
||||||
LOCK(g_wallet_release_mutex);
|
LOCK(g_wallet_release_mutex);
|
||||||
auto it = g_unloading_wallet_set.insert(name);
|
g_unloading_wallet_set.insert(name);
|
||||||
assert(it.second);
|
// 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.
|
// Time to ditch our shared_ptr and wait for ReleaseWallet call.
|
||||||
|
|
Loading…
Add table
Reference in a new issue