mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb: persist static loop-in risk decisions
Add schema, sqlc queries, store fields, and SqlStore support for recording server confirmation-risk decisions with static loop-in swaps. Store the decision timestamp so payment-deadline recovery can reconstruct elapsed time after restart.
This commit is contained in:
parent
b0f43bbe1e
commit
491fddbc34
9 changed files with 302 additions and 78 deletions
|
|
@ -33,6 +33,22 @@ SET
|
|||
WHERE
|
||||
swap_hash = $1;
|
||||
|
||||
-- name: RecordStaticAddressRiskDecision :exec
|
||||
UPDATE static_address_swaps
|
||||
SET
|
||||
confirmation_risk_decision = $2,
|
||||
confirmation_risk_decision_time = CASE
|
||||
WHEN confirmation_risk_decision = $2 THEN
|
||||
COALESCE(confirmation_risk_decision_time, $3)
|
||||
ELSE $3
|
||||
END
|
||||
WHERE
|
||||
swap_hash = $1
|
||||
AND NOT (
|
||||
confirmation_risk_decision = 'rejected'
|
||||
AND $2 = 'accepted'
|
||||
);
|
||||
|
||||
-- name: InsertStaticAddressMetaUpdate :exec
|
||||
INSERT INTO static_address_swap_updates (
|
||||
swap_hash,
|
||||
|
|
@ -147,7 +163,3 @@ WHERE
|
|||
d.swap_hash = $1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue