commit 4d4171fe53187e41bf5aab34d6e4e9d5bb9fdf8b
parent 8d3a96ebf43b2e1c2e537921c161124858fcd5b1
Author: ThomasV <thomasv@electrum.org>
Date: Fri, 23 Sep 2016 19:00:42 +0200
hardware multisig: partial bip45 derivation
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/base_wizard.py b/lib/base_wizard.py
@@ -208,9 +208,14 @@ class BaseWizard(object):
def on_device(self, name, device_info):
self.plugin = self.plugins.get_plugin(name)
self.plugin.setup_device(device_info, self)
- print device_info
- f = lambda x: self.run('on_hardware_account_id', name, device_info, int(x))
- self.account_id_dialog(f)
+ if self.wallet_type=='multisig':
+ # There is no general standard for HD multisig.
+ # This is partially compatible with BIP45; assumes index=0
+ self.on_hw_derivation(name, device_info, "m/45'/0")
+ else:
+ from keystore import bip44_derivation
+ f = lambda x: self.run('on_hw_derivation', name, device_info, bip44_derivation(int(x)))
+ self.account_id_dialog(f)
def account_id_dialog(self, f):
message = '\n'.join([
@@ -225,9 +230,8 @@ class BaseWizard(object):
return False
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):
- from keystore import hardware_keystore, bip44_derivation
- derivation = bip44_derivation(int(account_id))
+ def on_hw_derivation(self, name, device_info, derivation):
+ from keystore import hardware_keystore
xpub = self.plugin.get_xpub(device_info.device.id_, derivation, self)
if xpub is None:
self.show_error('Cannot read xpub from device')