fix: pending accounts
authorThomasV <thomasv@gitorious>
Fri, 2 May 2014 09:19:02 +0000 (11:19 +0200)
committerThomasV <thomasv@gitorious>
Fri, 2 May 2014 09:19:02 +0000 (11:19 +0200)
lib/account.py
lib/wallet.py

index e85373e..030a514 100644 (file)
@@ -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()
index bd57a92..ccb6855 100644 (file)
@@ -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)