tfix: pending accounts - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 2a938ad516fc996c67e30fc2b607888db723c47a DIR parent fdf8697e5832e033f72d0b8a88cebc85a7c9eabe HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 2 May 2014 11:19:02 +0200 fix: pending accounts Diffstat: M lib/account.py | 3 +++ M lib/wallet.py | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) --- DIR diff --git a/lib/account.py b/lib/account.py t@@ -57,6 +57,9 @@ class PendingAccount(Account): def has_change(self): return False + def dump(self): + return {'pending':self.addresses[0]} + class ImportedAccount(Account): def __init__(self, d): self.addresses = d.keys() DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -1361,16 +1361,17 @@ class Deterministic_Wallet(Abstract_Wallet): elif v.get('pending'): self.accounts[k] = PendingAccount(v) else: - raise + print_error("cannot load account", v) - def delete_pending_account(self, k): - assert self.is_pending_account(k) - self.accounts.pop(k) - self.save_accounts() def account_is_pending(self, k): return type(self.accounts.get(k)) == PendingAccount + def delete_pending_account(self, k): + assert self.account_is_pending(k) + self.accounts.pop(k) + self.save_accounts() + def create_pending_account(self, name, password): account_id, addr = self.next_account_address(password) self.set_label(account_id, name)