twallet.clear_requests. fixes #6279 - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit b0c390e231cf7a2e2b6fe831af88ea368f80027c DIR parent abac4a4340dc1aa82989ebea4032005bee048d6f HTML Author: ThomasV <thomasv@electrum.org> Date: Fri, 26 Jun 2020 09:47:16 +0200 wallet.clear_requests. fixes #6279 Diffstat: M electrum/commands.py | 4 ++-- M electrum/gui/kivy/uix/screens.py | 4 +--- M electrum/wallet.py | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) --- DIR diff --git a/electrum/commands.py b/electrum/commands.py t@@ -877,8 +877,8 @@ class Commands: @command('w') async def clear_requests(self, wallet: Abstract_Wallet = None): """Remove all payment requests""" - for k in list(wallet.receive_requests.keys()): - wallet.remove_payment_request(k) + wallet.clear_requests() + return True @command('w') async def clear_invoices(self, wallet: Abstract_Wallet = None): DIR diff --git a/electrum/gui/kivy/uix/screens.py b/electrum/gui/kivy/uix/screens.py t@@ -535,9 +535,7 @@ class ReceiveScreen(CScreen): return def callback(c): if c: - for req in requests: - key = req.get('rhash') or req['address'] - self.app.wallet.delete_request(key) + self.app.wallet.clear_requests() self.update() n = len(requests) d = Question(_('Delete {} requests?').format(n), callback) DIR diff --git a/electrum/wallet.py b/electrum/wallet.py t@@ -726,6 +726,10 @@ class Abstract_Wallet(AddressSynchronizer, ABC): self.invoices = {} self.save_db() + def clear_requests(self): + self.receive_requests = {} + self.save_db() + def get_invoices(self): out = list(self.invoices.values()) #out = list(filter(None, out)) filter out ln