From d52df3b94edf00616b66ea98e25ed01e5cccbceb Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 23 Jun 2022 12:33:21 +0200 Subject: [PATCH] Ensure ringdb is written after wallet creation --- src/WindowManager.cpp | 3 ++- src/libwalletqt/Wallet.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 64978a3..1ce6c38 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -279,7 +279,8 @@ void WindowManager::tryCreateWallet(Seed seed, const QString &path, const QStrin wallet->setCacheAttribute("feather.seed", seed.mnemonic.join(" ")); wallet->setCacheAttribute("feather.seedoffset", seedOffset); - this->onWalletOpened(wallet); + wallet->deleteLater(); + this->tryOpenWallet(path, password); } void WindowManager::tryCreateWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 76bc098..d97adbe 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -1413,18 +1413,18 @@ Wallet::~Wallet() m_scheduler.shutdownWaitForFinished(); - //Monero::WalletManagerFactory::getWalletManager()->closeWallet(m_walletImpl); - if(status() == Status_Critical || status() == Status_BadPassword) + if (status() == Status_Critical || status() == Status_BadPassword) qDebug("Not storing wallet cache"); - else if( m_walletImpl->store("")) + else if (m_walletImpl->store("")) qDebug("Wallet cache stored successfully"); else qDebug("Error storing wallet cache"); + delete m_walletImpl; m_walletImpl = nullptr; delete m_walletListener; - m_walletListener = NULL; - qDebug("m_walletImpl deleted"); + m_walletListener = nullptr; + qDebug("~Wallet: Closed"); } void Wallet::startRefreshThread()