1
0

lnworker: set request status after LN payment

This commit is contained in:
ThomasV
2021-03-09 09:35:43 +01:00
parent a125cd5392
commit ef661050c8
3 changed files with 13 additions and 7 deletions

View File

@@ -1617,9 +1617,6 @@ class LNWallet(LNWorker):
is_expired = True
elif total == expected_msat:
is_accepted = True
if self.get_payment_info(payment_hash) is not None:
self.set_payment_status(payment_hash, PR_PAID)
util.trigger_callback('request_status', self.wallet, payment_hash.hex(), PR_PAID)
if is_accepted or is_expired:
htlc_set.remove(key)
if len(htlc_set) > 0:
@@ -1652,6 +1649,11 @@ class LNWallet(LNWorker):
self.set_payment_status(bfh(key), status)
util.trigger_callback('invoice_status', self.wallet, key)
def set_request_status(self, payment_hash: bytes, status: int) -> None:
if self.get_payment_status(payment_hash) != status:
self.set_payment_status(payment_hash, status)
util.trigger_callback('request_status', self.wallet, payment_hash.hex(), status)
def set_payment_status(self, payment_hash: bytes, status: int) -> None:
info = self.get_payment_info(payment_hash)
if info is None: