From ea5c49b3ab9cf0737192f1f4e637fd55c75e9b12 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 10 Aug 2022 23:48:44 +0200 Subject: [PATCH] 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)` --- electrum/wallet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/wallet.py b/electrum/wallet.py index d45bff036..239701396 100644 --- a/electrum/wallet.py +++ b/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: