From 2a938ad516fc996c67e30fc2b607888db723c47a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 2 May 2014 11:19:02 +0200 Subject: [PATCH] fix: pending accounts --- lib/account.py | 3 +++ lib/wallet.py | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/account.py b/lib/account.py index e85373ec8..030a5149e 100644 --- a/lib/account.py +++ b/lib/account.py @@ -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() diff --git a/lib/wallet.py b/lib/wallet.py index bd57a92bb..ccb685564 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -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)