get_account_addresses: None->all user-visible a/cs

Otherwise we can end up sweeping to a non-visible address.
This commit is contained in:
Neil Booth 2016-01-23 18:07:02 +09:00
parent 83a531b3e4
commit 9729f5b6d3
1 changed files with 9 additions and 7 deletions

View File

@ -667,13 +667,15 @@ class Abstract_Wallet(PrintError):
return amount, fee return amount, fee
def get_account_addresses(self, acc_id, include_change=True): def get_account_addresses(self, acc_id, include_change=True):
if acc_id is None: '''acc_id of None means all user-visible accounts'''
addr_list = self.addresses(include_change) addr_list = []
elif acc_id in self.accounts: acc_ids = self.accounts_to_show() if acc_id is None else [acc_id]
acc = self.accounts[acc_id] for acc_id in acc_ids:
addr_list = acc.get_addresses(0) if acc_id in self.accounts:
if include_change: acc = self.accounts[acc_id]
addr_list += acc.get_addresses(1) addr_list += acc.get_addresses(0)
if include_change:
addr_list += acc.get_addresses(1)
return addr_list return addr_list
def get_account_from_address(self, addr): def get_account_from_address(self, addr):