electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 003e6c3e7966d1e22346a2b115bcaa6171ebfd08
parent 7aaac2ee307ea64b22cf3ad88305fe45e19ae439
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 14 May 2019 15:32:57 +0200

fix 2fa wallet creation via qt gui

closes #5334

Diffstat:
Melectrum/base_wizard.py | 4+++-
Melectrum/plugins/trustedcoin/qt.py | 9+++++++--
2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py @@ -560,11 +560,13 @@ class BaseWizard(Logger): self.terminate() def create_storage(self, path): + if os.path.exists(path): + raise Exception('file already exists at path') if not self.pw_args: return password, encrypt_storage, storage_enc_version = self.pw_args storage = WalletStorage(path) - storage.set_keystore_encryption(bool(password)) # and encrypt_keystore) + storage.set_keystore_encryption(bool(password)) if encrypt_storage: storage.set_password(password, enc_version=storage_enc_version) for key, value in self.data.items(): diff --git a/electrum/plugins/trustedcoin/qt.py b/electrum/plugins/trustedcoin/qt.py @@ -43,6 +43,7 @@ from electrum.i18n import _ from electrum.plugin import hook from electrum.util import is_valid_email from electrum.logging import Logger +from electrum.base_wizard import GoBack from .trustedcoin import TrustedCoinPlugin, server @@ -221,9 +222,13 @@ class Plugin(TrustedCoinPlugin): _('If you are online, click on "{}" to continue.').format(_('Next')) ] msg = '\n\n'.join(msg) - wizard.create_storage(wizard.path) wizard.reset_stack() - wizard.confirm_dialog(title='', message=msg, run_next = lambda x: wizard.run('accept_terms_of_use')) + try: + wizard.confirm_dialog(title='', message=msg, run_next = lambda x: wizard.run('accept_terms_of_use')) + except GoBack: + # user clicked 'Cancel' and decided to move wallet file manually + wizard.create_storage(wizard.path) + raise def accept_terms_of_use(self, window): vbox = QVBoxLayout()