aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2024-08-13 22:52:01 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2024-08-14 16:14:54 -0300
commit64e736d79efc7201768244fc297084f70c0bebc1 (patch)
treee64b78aea285d346e34b599f83ac52d44c2a5e44 /src/wallet/wallet.cpp
parent8872b4a6ca91a83bf8d5a118fb808c043b9e879d (diff)
downloadbitcoin-64e736d79efc7201768244fc297084f70c0bebc1.tar.xz
wallet: WaitForDeleteWallet, do not expect thread safety
Multiple threads could try to delete the wallet at the same time.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp5
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.