commit 06b9d485351e48967390b3b7edac181f0579a994
parent 43614af2c4557726daa4576a381fe63f8387c542
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 16 Dec 2020 10:05:17 +0100
kivy: allow address reuse in imported wallets. (fix #6852)
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/electrum/gui/kivy/uix/dialogs/request_dialog.py b/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
diff --git a/electrum/gui/kivy/uix/screens.py b/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)