Select unused addresses when copying receiving address. We don't use wallet.get_balance as that is deceptive (if you sent a tx to yourself or old used addresses can have a 0 balance) and get_history seems a bit much (to check the activity of an address, we'd have to filter many addresses). This is a nice reasonable compromise.

This commit is contained in:
Amir Taaki 2012-07-07 13:21:40 +02:00
parent b615fe0c8c
commit 7299c388e8
1 changed files with 2 additions and 0 deletions

View File

@ -443,6 +443,8 @@ class MiniActuator:
def copy_address(self, receive_popup):
addrs = [addr for addr in self.wallet.all_addresses()
if not self.wallet.is_change(addr)]
# Select most recent addresses from gap limit
addrs = addrs[-self.wallet.gap_limit:]
copied_address = random.choice(addrs)
qApp.clipboard().setText(copied_address)
receive_popup.setup(copied_address)