electrum

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

commit 94664566e731b2f118d109629c86b6eb32ee55f2
parent 247722fdec6b40e4250deb7b00ad7ea7d2b67d6f
Author: ThomasV <thomasv@electrum.org>
Date:   Sat,  5 Mar 2016 04:34:13 +0100

kivy: fix watching-only issue

Diffstat:
Mgui/kivy/uix/dialogs/installwizard.py | 6++----
Mlib/wallet.py | 4++++
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gui/kivy/uix/dialogs/installwizard.py b/gui/kivy/uix/dialogs/installwizard.py @@ -106,13 +106,11 @@ class InstallWizard(Widget): self.run('add_seed', (text, None)) msg = _('To create a watching-only wallet, paste your master public key, or scan it using the camera button.') - RestoreXpubDialog(test=Wallet.is_xpub, message=msg, on_release=on_xpub).open() + RestoreXpubDialog(test=Wallet.is_mpk, message=msg, on_release=on_xpub).open() def add_seed(self, text, password): def task(): - if not Wallet.is_seed(text): - raise BaseException("invalid seed") - self.wallet = Wallet.from_seed(text, password, self.storage) + self.wallet = Wallet.from_text(text, password, self.storage) self.wallet.create_main_account() self.wallet.synchronize() msg= _("Electrum is generating your addresses, please wait.") diff --git a/lib/wallet.py b/lib/wallet.py @@ -1988,6 +1988,10 @@ class Wallet(object): return is_old_seed(seed) or is_new_seed(seed) @staticmethod + def is_mpk(text): + return Wallet.is_old_mpk(text) or Wallet.is_xpub(text) + + @staticmethod def is_old_mpk(mpk): try: int(mpk, 16)