From 5e5191d25cccfdbdf2d7cb4445b756c7937b7e99 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 26 Oct 2017 20:30:39 +0200 Subject: [PATCH] base_wizard: only check xpub type if have xpub --- lib/base_wizard.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/base_wizard.py b/lib/base_wizard.py index a04d2de4b..5dd02d0a5 100644 --- a/lib/base_wizard.py +++ b/lib/base_wizard.py @@ -307,16 +307,19 @@ class BaseWizard(object): self.on_keystore(k) def on_keystore(self, k): - from .bitcoin import xpub_type - t1 = xpub_type(k.xpub) #fixme: old wallets + has_xpub = isinstance(k, keystore.Xpub) + if has_xpub: + from .bitcoin import xpub_type + t1 = xpub_type(k.xpub) if self.wallet_type == 'standard': - if t1 not in ['standard', 'p2wpkh', 'p2wpkh-p2sh']: + if has_xpub and t1 not in ['standard', 'p2wpkh', 'p2wpkh-p2sh']: self.show_error(_('Wrong key type') + ' %s'%t1) self.run('choose_keystore') return self.keystores.append(k) self.run('create_wallet') elif self.wallet_type == 'multisig': + assert has_xpub if t1 not in ['standard', 'p2wsh', 'p2wsh-p2sh']: self.show_error(_('Wrong key type') + ' %s'%t1) self.run('choose_keystore')