graph/db+sqldb: impl PutClosedScid and IsClosedScid

This commit is contained in:
Elle Mouton
2025-06-11 17:55:28 +02:00
parent 5effa96766
commit 933ab3c6b7
5 changed files with 101 additions and 1 deletions

View File

@ -709,3 +709,20 @@ LIMIT 1;
DELETE FROM prune_log
WHERE block_height >= @start_height
AND block_height <= @end_height;
/* ─────────────────────────────────────────────
closed_scid table queries
────────────────────────────────────────────-
*/
-- name: InsertClosedChannel :exec
INSERT INTO closed_scids (scid)
VALUES ($1)
ON CONFLICT (scid) DO NOTHING;
-- name: IsClosedChannel :one
SELECT EXISTS (
SELECT 1
FROM closed_scids
WHERE scid = $1
);