tlnworker: fix detection of already paid invoices - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 0062c6d69561991d5918163946344c1b10ed9588
DIR parent d6d5b999443cca8885bd6e2a31fb0fc9cccd335c
HTML Author: ThomasV <thomasv@electrum.org>
Date: Thu, 19 Sep 2019 11:57:47 +0200
lnworker: fix detection of already paid invoices
Diffstat:
M electrum/lnworker.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
DIR diff --git a/electrum/lnworker.py b/electrum/lnworker.py
t@@ -822,9 +822,7 @@ class LNWallet(LNWorker):
async def _pay(self, invoice, amount_sat=None, attempts=1):
addr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
key = bh2u(addr.paymenthash)
- status = self.get_invoice_status(key)
- if status == PR_PAID:
- # fixme: use lightning_preimaages, because invoices are not permanently stored
+ if key in self.preimages:
raise PaymentFailure(_("This invoice has been paid already"))
self._check_invoice(invoice, amount_sat)
self.save_invoice(addr.paymenthash, invoice, SENT, PR_INFLIGHT)