electrum

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

commit 0137626a63d0da8fffb186d11dccd203c86243bb
parent c25baf3dd7fb67b8884cb5f51c6bbad76f736b82
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 28 Aug 2018 18:20:35 +0200

wallet restore: remove dead code. add log lines.

Diffstat:
Melectrum/gui/qt/installwizard.py | 22----------------------
Melectrum/wallet.py | 8+++++---
2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/electrum/gui/qt/installwizard.py b/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) diff --git a/electrum/wallet.py b/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()