@@ -233,18 +233,18 @@ static void ReleaseWallet(CWallet* wallet)
233233 wallet->WalletLogPrintf (" Releasing wallet\n " );
234234 wallet->Flush ();
235235 delete wallet;
236- // Wallet is now released, notify UnloadWallet , if any.
236+ // Wallet is now released, notify WaitForDeleteWallet , if any.
237237 {
238238 LOCK (g_wallet_release_mutex);
239239 if (g_unloading_wallet_set.erase (name) == 0 ) {
240- // UnloadWallet was not called for this wallet, all done.
240+ // WaitForDeleteWallet was not called for this wallet, all done.
241241 return ;
242242 }
243243 }
244244 g_wallet_release_cv.notify_all ();
245245}
246246
247- void UnloadWallet (std::shared_ptr<CWallet>&& wallet)
247+ void WaitForDeleteWallet (std::shared_ptr<CWallet>&& wallet)
248248{
249249 // Mark wallet for unloading.
250250 const std::string name = wallet->GetName ();
@@ -4387,7 +4387,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
43874387 if (!RemoveWallet (context, wallet, /* load_on_start=*/ std::nullopt , warnings)) {
43884388 return util::Error{_ (" Unable to unload the wallet before migrating" )};
43894389 }
4390- UnloadWallet (std::move (wallet));
4390+ WaitForDeleteWallet (std::move (wallet));
43914391 was_loaded = true ;
43924392 } else {
43934393 // Check if the wallet is BDB
@@ -4531,7 +4531,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
45314531 error += _ (" \n Unable to cleanup failed migration" );
45324532 return util::Error{error};
45334533 }
4534- UnloadWallet (std::move (w));
4534+ WaitForDeleteWallet (std::move (w));
45354535 } else {
45364536 // Unloading for wallets in local context
45374537 assert (w.use_count () == 1 );
0 commit comments