fix: pending accounts
This commit is contained in:
parent
fdf8697e58
commit
2a938ad516
|
@ -57,6 +57,9 @@ class PendingAccount(Account):
|
||||||
def has_change(self):
|
def has_change(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def dump(self):
|
||||||
|
return {'pending':self.addresses[0]}
|
||||||
|
|
||||||
class ImportedAccount(Account):
|
class ImportedAccount(Account):
|
||||||
def __init__(self, d):
|
def __init__(self, d):
|
||||||
self.addresses = d.keys()
|
self.addresses = d.keys()
|
||||||
|
|
|
@ -1361,16 +1361,17 @@ class Deterministic_Wallet(Abstract_Wallet):
|
||||||
elif v.get('pending'):
|
elif v.get('pending'):
|
||||||
self.accounts[k] = PendingAccount(v)
|
self.accounts[k] = PendingAccount(v)
|
||||||
else:
|
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):
|
def account_is_pending(self, k):
|
||||||
return type(self.accounts.get(k)) == PendingAccount
|
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):
|
def create_pending_account(self, name, password):
|
||||||
account_id, addr = self.next_account_address(password)
|
account_id, addr = self.next_account_address(password)
|
||||||
self.set_label(account_id, name)
|
self.set_label(account_id, name)
|
||||||
|
|
Loading…
Reference in New Issue