mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Associate every deposit with the static address parameters that created it. This lets restored deposits recover the correct script and signing keys instead of assuming the legacy root address.
37 lines
715 B
SQL
37 lines
715 B
SQL
-- name: AllStaticAddresses :many
|
|
SELECT * FROM static_addresses
|
|
ORDER BY id ASC;
|
|
|
|
-- name: GetStaticAddress :one
|
|
SELECT * FROM static_addresses
|
|
WHERE pkscript=$1;
|
|
|
|
-- name: GetStaticAddressID :one
|
|
SELECT id FROM static_addresses
|
|
WHERE pkscript=$1;
|
|
|
|
-- name: CreateStaticAddress :exec
|
|
INSERT INTO static_addresses (
|
|
client_pubkey,
|
|
server_pubkey,
|
|
expiry,
|
|
client_key_family,
|
|
client_key_index,
|
|
pkscript,
|
|
protocol_version,
|
|
initiation_height
|
|
) VALUES (
|
|
$1,
|
|
$2,
|
|
$3,
|
|
$4,
|
|
$5,
|
|
$6,
|
|
$7,
|
|
$8
|
|
);
|
|
|
|
-- name: GetLegacyAddress :one
|
|
SELECT * FROM static_addresses
|
|
ORDER BY id ASC
|
|
LIMIT 1;
|