@ -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
async def clear_invoices(self, wallet: Abstract_Wallet = None):
@ -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)
@ -726,6 +726,10 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
self.invoices = {}
self.save_db()
def clear_requests(self):
self.receive_requests = {}
def get_invoices(self):
out = list(self.invoices.values())
#out = list(filter(None, out)) filter out ln