commit 4cfe98216ea4aa078df343e5676595e3c61891ce
parent b3c379b93952159ba8402930d55236427908f92e
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 30 Jan 2017 10:10:21 +0100
update ledger get_xpub
Diffstat:
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py
@@ -6,7 +6,8 @@ import sys
import traceback
import electrum
-from electrum.bitcoin import EncodeBase58Check, DecodeBase58Check, TYPE_ADDRESS, XPUB_HEADER, int_to_hex, var_int
+from electrum import bitcoin
+from electrum.bitcoin import TYPE_ADDRESS, int_to_hex, var_int
from electrum.i18n import _
from electrum.plugins import BasePlugin, hook
from electrum.keystore import Hardware_KeyStore, parse_xpubkey
@@ -78,15 +79,11 @@ class Ledger_Client():
childnum = int(lastChild[0])
else:
childnum = 0x80000000 | int(lastChild[0])
- xpub = XPUB_HEADER.decode('hex') + chr(depth) + self.i4b(fingerprint) + self.i4b(childnum) + str(nodeData['chainCode']) + str(publicKey)
- except Exception, e:
- #self.give_error(e, True)
+ xpub = bitcoin.serialize_xpub(0, str(nodeData['chainCode']), str(publicKey), depth, self.i4b(fingerprint), self.i4b(childnum))
+ return xpub
+ except Exception as e:
+ print_error(e)
return None
- finally:
- #self.handler.clear_dialog()
- pass
-
- return EncodeBase58Check(xpub)
def has_detached_pin_support(self, client):
try: