invoices/sqldb: query by ChanID when updating AMP invoice preimage

This commit is contained in:
Alex Akselrod authored and Andras Banki-Horvath committed 2024-09-03 19:40:45 +02:00
1 parent e8c5e7d5ce
commit f1b7953465
6 files changed
+14 -6

No files matched your search

+2 -2
View File
@@ -61,7 +61,7 @@ WHERE (
-- name: UpdateAMPSubInvoiceHTLCPreimage :execresult
UPDATE amp_sub_invoice_htlcs AS a
SET preimage = $4
SET preimage = $5
WHERE a.invoice_id = $1 AND a.set_id = $2 AND a.htlc_id = (
SELECT id FROM invoice_htlcs AS i WHERE i.htlc_id = $3
SELECT id FROM invoice_htlcs AS i WHERE i.chan_id = $3 AND i.htlc_id = $4
);