Browse Source

fix add_keypairs: support old wallets

283
ThomasV 11 years ago
parent
commit
785b54f8f4
  1. 12
      lib/wallet.py

12
lib/wallet.py

@ -409,15 +409,15 @@ class Abstract_Wallet:
else: else:
from account import BIP32_Account from account import BIP32_Account, OldAccount
print "scanning", x_pubkeys
for x_pubkey in x_pubkeys: for x_pubkey in x_pubkeys:
if not is_extended_pubkey(x_pubkey): if not is_extended_pubkey(x_pubkey):
continue continue
xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey) if x_pubkey[0:2] == 'ff':
print "xpub", xpub xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
elif x_pubkey[0:2] == 'fe':
xpub, sequence = OldAccount.parse_xpubkey(x_pubkey)
# look for account that can sign # look for account that can sign
for k, account in self.accounts.items(): for k, account in self.accounts.items():
@ -425,10 +425,8 @@ class Abstract_Wallet:
break break
else: else:
continue continue
print "found xpub", xpub, sequence
addr = account.get_address(*sequence) addr = account.get_address(*sequence)
print addr, txin['address']
assert txin['address'] == addr assert txin['address'] == addr
pk = self.get_private_key(addr, password) pk = self.get_private_key(addr, password)
for sec in pk: for sec in pk:

Loading…
Cancel
Save