Browse Source

fix 2fa wallet creation via qt gui

closes #5334
regtest_lnd
SomberNight 6 years ago
parent
commit
003e6c3e79
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/base_wizard.py
  2. 9
      electrum/plugins/trustedcoin/qt.py

4
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():

9
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()

Loading…
Cancel
Save