@@ -227,10 +227,10 @@ static std::set<std::string> g_loading_wallet_set GUARDED_BY(g_loading_wallet_mu
227
227
static std::set<std::string> g_unloading_wallet_set GUARDED_BY (g_wallet_release_mutex);
228
228
229
229
// Custom deleter for shared_ptr<CWallet>.
230
- static void ReleaseWallet (CWallet* wallet)
230
+ static void FlushAndDeleteWallet (CWallet* wallet)
231
231
{
232
232
const std::string name = wallet->GetName ();
233
- wallet->WalletLogPrintf (" Releasing wallet\n " );
233
+ wallet->WalletLogPrintf (" Releasing wallet %s.. \n " , name );
234
234
wallet->Flush ();
235
235
delete wallet;
236
236
// Wallet is now released, notify WaitForDeleteWallet, if any.
@@ -255,7 +255,7 @@ void WaitForDeleteWallet(std::shared_ptr<CWallet>&& wallet)
255
255
// Multiple threads could simultaneously be waiting for deletion.
256
256
}
257
257
258
- // Time to ditch our shared_ptr and wait for ReleaseWallet call.
258
+ // Time to ditch our shared_ptr and wait for FlushAndDeleteWallet call.
259
259
wallet.reset ();
260
260
{
261
261
WAIT_LOCK (g_wallet_release_mutex, lock);
@@ -2972,7 +2972,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
2972
2972
const auto start{SteadyClock::now ()};
2973
2973
// TODO: Can't use std::make_shared because we need a custom deleter but
2974
2974
// should be possible to use std::allocate_shared.
2975
- std::shared_ptr<CWallet> walletInstance (new CWallet (chain, name, std::move (database)), ReleaseWallet );
2975
+ std::shared_ptr<CWallet> walletInstance (new CWallet (chain, name, std::move (database)), FlushAndDeleteWallet );
2976
2976
walletInstance->m_keypool_size = std::max (args.GetIntArg (" -keypool" , DEFAULT_KEYPOOL_SIZE), int64_t {1 });
2977
2977
walletInstance->m_notify_tx_changed_script = args.GetArg (" -walletnotify" , " " );
2978
2978
0 commit comments