commit 785b54f8f49e49051418d1ac95b9863fb781904a
parent f410225dc2396dcdeb1402c62853728275c80554
Author: ThomasV <thomasv@gitorious>
Date: Sat, 21 Jun 2014 21:39:57 +0200
fix add_keypairs: support old wallets
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -409,15 +409,15 @@ class Abstract_Wallet:
else:
- from account import BIP32_Account
- print "scanning", x_pubkeys
-
+ from account import BIP32_Account, OldAccount
for x_pubkey in x_pubkeys:
if not is_extended_pubkey(x_pubkey):
continue
- xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
- print "xpub", xpub
+ if x_pubkey[0:2] == 'ff':
+ 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
for k, account in self.accounts.items():
@@ -425,10 +425,8 @@ class Abstract_Wallet:
break
else:
continue
- print "found xpub", xpub, sequence
addr = account.get_address(*sequence)
- print addr, txin['address']
assert txin['address'] == addr
pk = self.get_private_key(addr, password)
for sec in pk: