tfix #4219 - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 42582b6a643460e0cae64c8b6ad4998da11a461b DIR parent 5a508f7b8d07835d54aec8b9c22a9b2c25609357 HTML Author: SomberNight <somber.night@protonmail.com> Date: Tue, 3 Apr 2018 02:48:55 +0200 fix #4219 Diffstat: M gui/qt/main_window.py | 3 +++ M lib/paymentrequest.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) --- DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -1838,6 +1838,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def show_invoice(self, key): pr = self.invoices.get(key) + if pr is None: + self.show_error('Cannot find payment request in wallet.') + return pr.verify(self.contacts) self.show_pr_details(pr) DIR diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py t@@ -453,7 +453,11 @@ class InvoiceStore(object): def set_paid(self, pr, txid): pr.tx = txid - self.paid[txid] = pr.get_id() + pr_id = pr.get_id() + self.paid[txid] = pr_id + if pr_id not in self.invoices: + # in case the user had deleted it previously + self.add(pr) def load(self, d): for k, v in d.items():