File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2580,7 +2580,6 @@ def log_fail_reason(reason: str):
25802580 fw_payment_key = payment_key )
25812581 return None , (payment_key , callback )
25822582
2583- # TODO don't accept payments twice for same invoice
25842583 info = self .lnworker .get_payment_info (payment_hash )
25852584 if info is None :
25862585 log_fail_reason (f"no payment_info found for RHASH { htlc .payment_hash .hex ()} " )
@@ -2616,6 +2615,10 @@ def log_fail_reason(reason: str):
26162615 log_fail_reason (f"remaining locktime smaller than requested { blocks_to_expiry = } < { info .min_final_cltv_delta = } " )
26172616 raise exc_incorrect_or_unknown_pd
26182617
2618+ if info .status == PR_PAID :
2619+ log_fail_reason (f"invoice has already been paid" )
2620+ raise exc_incorrect_or_unknown_pd
2621+
26192622 self .lnworker .verified_pending_htlcs [htlc_key ] = None
26202623
26212624 hold_invoice_callback = self .lnworker .hold_invoice_callbacks .get (payment_hash )
You can’t perform that action at this time.
0 commit comments