From 64e736d79efc7201768244fc297084f70c0bebc1 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Tue, 13 Aug 2024 22:52:01 -0300 Subject: wallet: WaitForDeleteWallet, do not expect thread safety Multiple threads could try to delete the wallet at the same time. --- src/wallet/wallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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&& 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. -- cgit v1.2.3