base_wizard: only check xpub type if have xpub
This commit is contained in:
parent
a89fe91815
commit
5e5191d25c
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue