diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2024-08-13 22:52:01 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2024-08-14 16:14:54 -0300 |
commit | 64e736d79efc7201768244fc297084f70c0bebc1 (patch) | |
tree | e64b78aea285d346e34b599f83ac52d44c2a5e44 /src | |
parent | 8872b4a6ca91a83bf8d5a118fb808c043b9e879d (diff) |
wallet: WaitForDeleteWallet, do not expect thread safety
Multiple threads could try to delete the wallet at the same time.
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4734fc7b1d..09e12d52b9 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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. |