mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb+sweepbatcher: add GetParentBatch and TotalSwept calls
This commit is contained in:
parent
c094ad4a85
commit
b4ebb19a77
6 changed files with 159 additions and 0 deletions
|
|
@ -62,6 +62,29 @@ INSERT INTO sweeps (
|
|||
amt = $5,
|
||||
completed = $6;
|
||||
|
||||
-- name: GetParentBatch :one
|
||||
SELECT
|
||||
sweep_batches.*
|
||||
FROM
|
||||
sweep_batches
|
||||
JOIN
|
||||
sweeps ON sweep_batches.id = sweeps.batch_id
|
||||
WHERE
|
||||
sweeps.swap_hash = $1
|
||||
AND
|
||||
sweeps.completed = TRUE
|
||||
AND
|
||||
sweep_batches.confirmed = TRUE;
|
||||
|
||||
-- name: GetBatchSweptAmount :one
|
||||
SELECT
|
||||
SUM(amt) AS total
|
||||
FROM
|
||||
sweeps
|
||||
WHERE
|
||||
batch_id = $1
|
||||
AND
|
||||
completed = TRUE;
|
||||
|
||||
-- name: GetBatchSweeps :many
|
||||
SELECT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue