Fix the backwards-compat 'next_account2' code

This commit is contained in:
Neil Booth 2016-01-10 19:26:17 +09:00
parent 5baa5feb11
commit 4743f033b4
1 changed files with 5 additions and 2 deletions

View File

@ -1666,8 +1666,11 @@ class BIP32_HD_Wallet(BIP32_Wallet):
BIP32_Wallet.__init__(self, storage) BIP32_Wallet.__init__(self, storage)
# Backwards-compatibility. Remove legacy "next_account2" and # Backwards-compatibility. Remove legacy "next_account2" and
# drop unused master public key to avoid duplicate errors # drop unused master public key to avoid duplicate errors
storage.put('next_account2', None) acc2 = storage.get('next_account2', None)
self.master_public_keys.pop(self.next_derivation()[0], None) if acc2:
storage.put('next_account2', None)
self.master_public_keys.pop(self.root_name + acc2[0] + "'", None)
self.storage.put('master_public_keys', self.master_public_keys)
def next_account_number(self): def next_account_number(self):
assert (set(self.accounts.keys()) == assert (set(self.accounts.keys()) ==