mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 20:35:13 +00:00
fix get_private_key_from_xpubkey
This commit is contained in:
parent
24b6ae7757
commit
fb75e2e53d
1 changed files with 6 additions and 5 deletions
|
@ -780,7 +780,6 @@ class Abstract_Wallet(object):
|
||||||
x_pubkeys = tx.inputs_to_sign()
|
x_pubkeys = tx.inputs_to_sign()
|
||||||
for x in x_pubkeys:
|
for x in x_pubkeys:
|
||||||
sec = self.get_private_key_from_xpubkey(x, password)
|
sec = self.get_private_key_from_xpubkey(x, password)
|
||||||
print "sec", sec
|
|
||||||
if sec:
|
if sec:
|
||||||
keypairs[ x ] = sec
|
keypairs[ x ] = sec
|
||||||
if keypairs:
|
if keypairs:
|
||||||
|
@ -1020,10 +1019,12 @@ class Abstract_Wallet(object):
|
||||||
return self.get_private_key(addr, password)[0]
|
return self.get_private_key(addr, password)[0]
|
||||||
elif x_pubkey[0:2] == 'ff':
|
elif x_pubkey[0:2] == 'ff':
|
||||||
xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
|
xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
|
||||||
for k, account in self.accounts.items():
|
for k, v in self.master_public_keys.items():
|
||||||
if xpub in account.get_master_pubkeys():
|
if v == xpub:
|
||||||
pk = account.get_private_key(sequence, self, password)
|
xprv = self.get_master_private_key(k, password)
|
||||||
return pk[0]
|
if xprv:
|
||||||
|
_, _, _, c, k = deserialize_xkey(xprv)
|
||||||
|
return bip32_private_key(sequence, k, c)
|
||||||
elif x_pubkey[0:2] == 'fe':
|
elif x_pubkey[0:2] == 'fe':
|
||||||
xpub, sequence = OldAccount.parse_xpubkey(x_pubkey)
|
xpub, sequence = OldAccount.parse_xpubkey(x_pubkey)
|
||||||
for k, account in self.accounts.items():
|
for k, account in self.accounts.items():
|
||||||
|
|
Loading…
Add table
Reference in a new issue