Revert "follow bip45 derivation with hardware multisig"
This reverts commit c24d38cd97
.
This commit is contained in:
parent
c24d38cd97
commit
dd39931833
|
@ -214,7 +214,7 @@ class BaseWizard(object):
|
||||||
|
|
||||||
def account_id_dialog(self, f):
|
def account_id_dialog(self, f):
|
||||||
message = '\n'.join([
|
message = '\n'.join([
|
||||||
_('Enter your account number here.'),
|
_('Enter your BIP44 account number here.'),
|
||||||
_('If you are not sure what this is, leave this field to zero.')
|
_('If you are not sure what this is, leave this field to zero.')
|
||||||
])
|
])
|
||||||
def is_int(x):
|
def is_int(x):
|
||||||
|
@ -226,7 +226,8 @@ class BaseWizard(object):
|
||||||
self.line_dialog(run_next=f, title=_('Account Number'), message=message, default='0', test=is_int)
|
self.line_dialog(run_next=f, title=_('Account Number'), message=message, default='0', test=is_int)
|
||||||
|
|
||||||
def on_hardware_account_id(self, name, device_info, account_id):
|
def on_hardware_account_id(self, name, device_info, account_id):
|
||||||
derivation = keystore.bip44_derivation(int(account_id), self.wallet_type == 'multisig')
|
from keystore import hardware_keystore, bip44_derivation
|
||||||
|
derivation = bip44_derivation(int(account_id))
|
||||||
xpub = self.plugin.get_xpub(device_info.device.id_, derivation, self)
|
xpub = self.plugin.get_xpub(device_info.device.id_, derivation, self)
|
||||||
if xpub is None:
|
if xpub is None:
|
||||||
self.show_error('Cannot read xpub from device')
|
self.show_error('Cannot read xpub from device')
|
||||||
|
@ -238,7 +239,7 @@ class BaseWizard(object):
|
||||||
'xpub': xpub,
|
'xpub': xpub,
|
||||||
'label': device_info.label,
|
'label': device_info.label,
|
||||||
}
|
}
|
||||||
k = keystore.hardware_keystore(d)
|
k = hardware_keystore(d)
|
||||||
self.on_keystore(k)
|
self.on_keystore(k)
|
||||||
|
|
||||||
def restore_from_seed(self):
|
def restore_from_seed(self):
|
||||||
|
@ -273,7 +274,7 @@ class BaseWizard(object):
|
||||||
def on_bip44(self, seed, passphrase, account_id):
|
def on_bip44(self, seed, passphrase, account_id):
|
||||||
k = keystore.BIP32_KeyStore({})
|
k = keystore.BIP32_KeyStore({})
|
||||||
bip32_seed = keystore.bip39_to_seed(seed, passphrase)
|
bip32_seed = keystore.bip39_to_seed(seed, passphrase)
|
||||||
derivation = keystore.bip44_derivation(account_id, self.wallet_type == 'multisig')
|
derivation = "m/44'/0'/%d'"%account_id
|
||||||
k.add_xprv_from_seed(bip32_seed, derivation)
|
k.add_xprv_from_seed(bip32_seed, derivation)
|
||||||
self.on_keystore(k)
|
self.on_keystore(k)
|
||||||
|
|
||||||
|
|
|
@ -635,9 +635,8 @@ is_any_key = lambda x: is_old_mpk(x) or is_xprv(x) or is_xpub(x) or is_address_l
|
||||||
is_private_key = lambda x: is_xprv(x) or is_private_key_list(x)
|
is_private_key = lambda x: is_xprv(x) or is_private_key_list(x)
|
||||||
is_bip32_key = lambda x: is_xprv(x) or is_xpub(x)
|
is_bip32_key = lambda x: is_xprv(x) or is_xpub(x)
|
||||||
|
|
||||||
def bip44_derivation(account_id, multisig=False):
|
def bip44_derivation(account_id):
|
||||||
n = 45 if multisig else 44
|
return "m/44'/0'/%d'"% int(account_id)
|
||||||
return "m/%d'/0'/%d'"% (n, account_id)
|
|
||||||
|
|
||||||
def from_seed(seed, passphrase):
|
def from_seed(seed, passphrase):
|
||||||
if is_old_seed(seed):
|
if is_old_seed(seed):
|
||||||
|
|
Loading…
Reference in New Issue