From ef8d7e3227a11995bc3278e69229538b47cc31a8 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 1 Mar 2019 19:44:20 +0100 Subject: [PATCH] qt wizard: don't consider old version storage to be incomplete --- electrum/gui/qt/installwizard.py | 6 ++++-- electrum/storage.py | 10 +--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/electrum/gui/qt/installwizard.py b/electrum/gui/qt/installwizard.py index a91d7a541..d0dc8f718 100644 --- a/electrum/gui/qt/installwizard.py +++ b/electrum/gui/qt/installwizard.py @@ -16,7 +16,7 @@ from PyQt5.QtWidgets import (QWidget, QDialog, QLabel, QHBoxLayout, QMessageBox, from electrum.wallet import Wallet from electrum.storage import WalletStorage -from electrum.util import UserCancelled, InvalidPassword +from electrum.util import UserCancelled, InvalidPassword, WalletFileException from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET, GoBack from electrum.i18n import _ @@ -307,7 +307,9 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): return action = storage.get_action() - if action: #< and action not in ('new', 'upgrade_storage'): + if action and storage.requires_upgrade(): + raise WalletFileException('Incomplete wallet files cannot be upgraded.') + if action: self.hide() msg = _("The file '{}' contains an incompletely created wallet.\n" "Do you want to complete its creation now?").format(path) diff --git a/electrum/storage.py b/electrum/storage.py index 73cf9e8ed..5d2ef1c49 100644 --- a/electrum/storage.py +++ b/electrum/storage.py @@ -240,12 +240,4 @@ class WalletStorage(PrintError): def get_action(self): action = run_hook('get_action', self) - if self.file_exists() and self.requires_upgrade(): - if action: - raise WalletFileException('Incomplete wallet files cannot be upgraded.') - return 'upgrade_storage' - if action: - return action - if not self.file_exists(): - return 'new' - + return action