Skip to content

Commit 64e736d

Browse files
ryanofskyfurszy
authored andcommitted
wallet: WaitForDeleteWallet, do not expect thread safety
Multiple threads could try to delete the wallet at the same time.
1 parent 8872b4a commit 64e736d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ void WaitForDeleteWallet(std::shared_ptr<CWallet>&& wallet)
250250
const std::string name = wallet->GetName();
251251
{
252252
LOCK(g_wallet_release_mutex);
253-
auto it = g_unloading_wallet_set.insert(name);
254-
assert(it.second);
253+
g_unloading_wallet_set.insert(name);
254+
// Do not expect to be the only one removing this wallet.
255+
// Multiple threads could simultaneously be waiting for deletion.
255256
}
256257

257258
// Time to ditch our shared_ptr and wait for ReleaseWallet call.

0 commit comments

Comments
 (0)