From 76cf1fea7aecc97271433a49675e022c6543a76a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 14 Nov 2011 20:41:55 +0100 Subject: [PATCH] fix --- client/electrum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/electrum.py b/client/electrum.py index 506d60655..c3e6375a0 100755 --- a/client/electrum.py +++ b/client/electrum.py @@ -286,7 +286,7 @@ class Wallet: for i in range(100000): oldseed = seed seed = hashlib.sha512(seed + oldseed).digest() - i = len( self.addresses ) + i = len( self.addresses ) - len(self.change_addresses) if not for_change else len(self.change_addresses) seed = Hash( "%d:%d:"%(i,for_change) + seed ) order = generator_secp256k1.order() secexp = ecdsa.util.randrange_from_seed__trytryagain( seed, order ) @@ -301,7 +301,7 @@ class Wallet: raise InvalidPassword("") self.private_keys = self.pw_encode( repr(private_keys), password) self.addresses.append(address) - if for_change: self.change_addresses.append( i ) + if for_change: self.change_addresses.append( len(self.addresses) - 1 ) h = self.retrieve_history(address) self.history[address] = h self.status[address] = h[-1]['blk_hash'] if h else None