electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 9729f5b6d3ccc42ac02c04e3614cfb3bfd1ea42f
parent 83a531b3e4c18e3bd418b205aa7da0511dee1f73
Author: Neil Booth <kyuupichan@gmail.com>
Date:   Sat, 23 Jan 2016 18:07:02 +0900

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

Otherwise we can end up sweeping to a non-visible address.

Diffstat:
Mlib/wallet.py | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

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