From 1cf93f99cc186d0a23ff3a64a5aaaba2af54f223 Mon Sep 17 00:00:00 2001 From: gg Date: Mon, 12 Jan 2026 08:59:57 -0500 Subject: [PATCH] fix file close cache bug --- src/model/WalletKeysFilesModel.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/model/WalletKeysFilesModel.cpp b/src/model/WalletKeysFilesModel.cpp index 58bc703c..fc85eaa9 100644 --- a/src/model/WalletKeysFilesModel.cpp +++ b/src/model/WalletKeysFilesModel.cpp @@ -97,18 +97,19 @@ void WalletKeysFilesModel::findWallets() { if (Utils::fileExists(basePath + ".address.txt")) { QFile file(basePath + ".address.txt"); - if (!file.open(QFile::ReadOnly | QFile::Text)) - continue; - const QString _address = QString::fromUtf8(file.readAll()); - - if (!_address.isEmpty()) { - addr = _address; - if (addr.startsWith("5") || addr.startsWith("7")) - networkType = NetworkType::STAGENET; - else if (addr.startsWith("9") || addr.startsWith("B")) - networkType = NetworkType::TESTNET; + if (file.open(QFile::ReadOnly | QFile::Text)) { + const QString _address = QString::fromUtf8(file.readAll()); + + if (!_address.isEmpty()) { + addr = _address; + if (addr.startsWith("5") || addr.startsWith("7")) + networkType = NetworkType::STAGENET; + else if (addr.startsWith("9") || addr.startsWith("B")) + networkType = NetworkType::TESTNET; + } + file.close(); } - file.close(); + // If file can't be opened, just proceed without the cached address } this->addWalletKeysFile(WalletKeysFile(fileInfo, networkType, std::move(addr))); -- 2.52.0