diff --git a/lib/base_wizard.py b/lib/base_wizard.py index a04d2de4..5dd02d0a 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')