Browse Source

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.

283
Amir Taaki 13 years ago
parent
commit
7299c388e8
  1. 2
      lib/gui_lite.py

2
lib/gui_lite.py

@ -443,6 +443,8 @@ class MiniActuator:
def copy_address(self, receive_popup): def copy_address(self, receive_popup):
addrs = [addr for addr in self.wallet.all_addresses() addrs = [addr for addr in self.wallet.all_addresses()
if not self.wallet.is_change(addr)] 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) copied_address = random.choice(addrs)
qApp.clipboard().setText(copied_address) qApp.clipboard().setText(copied_address)
receive_popup.setup(copied_address) receive_popup.setup(copied_address)

Loading…
Cancel
Save