Browse Source

wallet.delete_request(key): piggyback on get_request(key)

So that the two methods are consistent with each other.

As concrete motivation, see e.g.
- how the `getrequest(key)` command calls `wallet.get_request(key)`, and
- the `delete_request(address)` command calls `wallet.delete_request(address)`
patch-4
SomberNight 2 years ago
parent
commit
ea5c49b3ab
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/wallet.py

4
electrum/wallet.py

@ -2518,9 +2518,11 @@ class Abstract_Wallet(ABC, Logger, EventListener):
def delete_request(self, key, *, write_to_disk: bool = True):
""" lightning or on-chain """
req = self._receive_requests.pop(key, None)
req = self.get_request(key)
if req is None:
return
key = self.get_key_for_receive_request(req)
self._receive_requests.pop(key, None)
if req.is_lightning() and (addr:=req.get_address()):
self._requests_addr_to_rhash.pop(addr)
if req.is_lightning() and self.lnworker:

Loading…
Cancel
Save