Browse Source

kivy: allow address reuse in imported wallets. (fix #6852)

patch-4
ThomasV 4 years ago
parent
commit
06b9d48535
  1. 4
      electrum/gui/kivy/uix/dialogs/request_dialog.py
  2. 7
      electrum/gui/kivy/uix/screens.py

4
electrum/gui/kivy/uix/dialogs/request_dialog.py

@ -116,6 +116,10 @@ class RequestDialog(Factory.Popup):
if self.status == PR_UNPAID and self.is_lightning and self.app.wallet.lnworker:
if self.amount_sat and self.amount_sat > self.app.wallet.lnworker.num_sats_can_receive():
self.warning = _('Warning') + ': ' + _('This amount exceeds the maximum you can currently receive with your channels')
if self.status == PR_UNPAID and not self.is_lightning:
address = req.get_address()
if self.app.wallet.is_used(address):
self.warning = _('Warning') + ': ' + _('This address is being reused')
def on_dismiss(self):
self.app.request_popup = None

7
electrum/gui/kivy/uix/screens.py

@ -491,8 +491,11 @@ class ReceiveScreen(CScreen):
else:
addr = self.address or self.app.wallet.get_unused_address()
if not addr:
self.app.show_info(_('No address available. Please remove some of your pending requests.'))
return
if not self.app.wallet.is_deterministic():
addr = self.app.wallet.get_receiving_address()
else:
self.app.show_info(_('No address available. Please remove some of your pending requests.'))
return
self.address = addr
req = self.app.wallet.make_payment_request(addr, amount, message, self.expiry())
self.app.wallet.add_payment_request(req)

Loading…
Cancel
Save