sqldb: add queries for deleting a payment and attempts
This commit is contained in:
4 files changed
+42
No files matched your search
@@ -151,3 +151,13 @@ FROM payment_hop_custom_records l
|
||||
WHERE l.hop_id IN (sqlc.slice('hop_ids')/*SLICE:hop_ids*/)
|
||||
ORDER BY l.hop_id ASC, l.key ASC;
|
||||
|
||||
|
||||
-- name: DeletePayment :exec
|
||||
DELETE FROM payments WHERE id = $1;
|
||||
|
||||
-- name: DeleteFailedAttempts :exec
|
||||
-- Delete all failed HTLC attempts for the given payment. Resolution type 2
|
||||
-- indicates a failed attempt.
|
||||
DELETE FROM payment_htlc_attempts WHERE payment_id = $1 AND attempt_index IN (
|
||||
SELECT attempt_index FROM payment_htlc_attempt_resolutions WHERE resolution_type = 2
|
||||
);
|
||||
Reference in new issue
Block a user