Browse Source

wallet restore: remove dead code. add log lines.

3.2.x
SomberNight 6 years ago
parent
commit
0137626a63
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 22
      electrum/gui/qt/installwizard.py
  2. 8
      electrum/wallet.py

22
electrum/gui/qt/installwizard.py

@ -102,7 +102,6 @@ def wizard_dialog(func):
class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
accept_signal = pyqtSignal()
synchronized_signal = pyqtSignal(str)
def __init__(self, config, app, plugins, storage):
BaseWizard.__init__(self, config, plugins, storage)
@ -448,27 +447,6 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
self.exec_layout(playout.layout())
return playout.encrypt_cb.isChecked()
def show_restore(self, wallet, network):
# FIXME: these messages are shown after the install wizard is
# finished and the window closed. On macOS they appear parented
# with a re-appeared ghost install wizard window...
if network:
def task():
wallet.wait_until_synchronized()
if wallet.is_found():
msg = _("Recovery successful")
else:
msg = _("No transactions found for this seed")
self.synchronized_signal.emit(msg)
self.synchronized_signal.connect(self.show_message)
t = threading.Thread(target = task)
t.daemon = True
t.start()
else:
msg = _("This wallet was restored offline. It may "
"contain more addresses than displayed.")
self.show_message(msg)
@wizard_dialog
def confirm_dialog(self, title, message, run_next):
self.confirm(message, title)

8
electrum/wallet.py

@ -643,22 +643,24 @@ class Abstract_Wallet(AddressSynchronizer):
self.set_up_to_date(False)
while not self.is_up_to_date():
if callback:
msg = "%s\n%s %d"%(
msg = "{}\n{} {}".format(
_("Please wait..."),
_("Addresses generated:"),
len(self.addresses(True)))
len(self.get_addresses()))
callback(msg)
time.sleep(0.1)
def wait_for_network():
while not self.network.is_connected():
if callback:
msg = "%s \n" % (_("Connecting..."))
msg = "{} \n".format(_("Connecting..."))
callback(msg)
time.sleep(0.1)
# wait until we are connected, because the user
# might have selected another server
if self.network:
self.print_error("waiting for network...")
wait_for_network()
self.print_error("waiting while wallet is syncing...")
wait_for_wallet()
else:
self.synchronize()

Loading…
Cancel
Save