fix #2133: deserialize_xkey
This commit is contained in:
@@ -285,7 +285,7 @@ def get_user_id(storage):
|
||||
return long_id, short_id
|
||||
|
||||
def make_xpub(xpub, s):
|
||||
_, _, _, c, cK = deserialize_xkey(xpub)
|
||||
_, _, _, c, cK = deserialize_xpub(xpub)
|
||||
cK2, c2 = bitcoin._CKD_pub(cK, c, s)
|
||||
xpub2 = ("0488B21E" + "00" + "00000000" + "00000000").decode("hex") + c2 + cK2
|
||||
return EncodeBase58Check(xpub2)
|
||||
@@ -294,7 +294,7 @@ def make_xpub(xpub, s):
|
||||
def make_billing_address(wallet, num):
|
||||
long_id, short_id = wallet.get_user_id()
|
||||
xpub = make_xpub(billing_xpub, long_id)
|
||||
_, _, _, c, cK = deserialize_xkey(xpub)
|
||||
_, _, _, c, cK = deserialize_xpub(xpub)
|
||||
cK, c = bitcoin.CKD_pub(cK, c, num)
|
||||
address = public_key_to_bc_address( cK )
|
||||
return address
|
||||
@@ -524,8 +524,7 @@ class TrustedCoinPlugin(BasePlugin):
|
||||
challenge = r.get('challenge')
|
||||
message = 'TRUSTEDCOIN CHALLENGE: ' + challenge
|
||||
def f(xprv):
|
||||
from electrum.bitcoin import deserialize_xkey, bip32_private_key, regenerate_key, is_compressed
|
||||
_, _, _, c, k = deserialize_xkey(xprv)
|
||||
_, _, _, c, k = deserialize_xprv(xprv)
|
||||
pk = bip32_private_key([0, 0], k, c)
|
||||
key = regenerate_key(pk)
|
||||
compressed = is_compressed(pk)
|
||||
|
||||
Reference in New Issue
Block a user