sqldb/sqlc: add AddV2ChannelProof query

Add SQL query to update the signature column for v2 channel auth proofs.
Unlike v1 which requires four separate signatures, v2 channels use a
single aggregated signature.
This commit is contained in:
Elle Mouton committed 2026-02-13 07:21:23 +02:00
1 parent a73189ccec
commit 315f5ed741
3 files changed
+23

No files matched your search

+16
View File
@@ -55,6 +55,22 @@ func (q *Queries) AddV1ChannelProof(ctx context.Context, arg AddV1ChannelProofPa
)
}
const addV2ChannelProof = `-- name: AddV2ChannelProof :execresult
UPDATE graph_channels
SET signature = $2
WHERE scid = $1
AND version = 2
`
type AddV2ChannelProofParams struct {
Scid []byte
Signature []byte
}
func (q *Queries) AddV2ChannelProof(ctx context.Context, arg AddV2ChannelProofParams) (sql.Result, error) {
return q.db.ExecContext(ctx, addV2ChannelProof, arg.Scid, arg.Signature)
}
const countZombieChannels = `-- name: CountZombieChannels :one
SELECT COUNT(*)
FROM graph_zombie_channels