From: gg Date: Mon, 12 Jan 2026 13:59:57 +0000 (-0500) Subject: fix file close cache bug X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=1cf93f99cc186d0a23ff3a64a5aaaba2af54f223;p=gamesguru%2Ffeather.git fix file close cache bug --- 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)));