Browse Source

wallet.clear_requests. fixes #6279

bip39-recovery
ThomasV 5 years ago
parent
commit
b0c390e231
  1. 4
      electrum/commands.py
  2. 4
      electrum/gui/kivy/uix/screens.py
  3. 4
      electrum/wallet.py

4
electrum/commands.py

@ -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):

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

@ -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)

4
electrum/wallet.py

@ -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

Loading…
Cancel
Save