Browse Source

fix get_private_key for old addresses

283
ThomasV 11 years ago
parent
commit
fe538cc310
  1. 3
      lib/account.py
  2. 9
      lib/wallet.py

3
lib/account.py

@ -95,7 +95,8 @@ class OldAccount(Account):
compressed = False
return SecretToASecret( pk, compressed )
def get_private_key(self, for_change, n, seed):
def get_private_key(self, seed, sequence):
for_change, n = sequence
secexp = self.stretch_key(seed)
return self.get_private_key_from_stretched_exponent(for_change, n, secexp)

9
lib/wallet.py

@ -463,6 +463,9 @@ class Wallet:
def get_keyID(self, account, sequence):
if account == 0:
return 'old'
rs = self.rebase_sequence(account, sequence)
dd = []
for root, public_sequence in rs:
@ -489,6 +492,12 @@ class Wallet:
out.append( pw_decode( self.imported_keys[address], password ) )
else:
account, sequence = self.get_address_index(address)
if account == 0:
seed = self.decode_seed(password)
pk = self.accounts[account].get_private_key(seed, sequence)
out.append(pk)
return out
# assert address == self.accounts[account].get_address(*sequence)
rs = self.rebase_sequence( account, sequence)
for root, public_sequence in rs:

Loading…
Cancel
Save