commit 50a1a07b4bf14eff16e59d12fde105220a541093
parent ac164812eb3dfee405db4a719e9662f4ec9a221a
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Wed, 5 Jun 2024 07:57:18 +0200
fix: wire-gateway-api
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/c2ec/db-postgres.go b/c2ec/db-postgres.go
@@ -508,7 +508,7 @@ func (db *C2ECPostgres) GetConfirmedWithdrawals(start int, delta int, since time
// start negative indicates not explicitly given
// since -d is the case here we try reading the latest entries
// -d / -s
- query = "SELECT * FROM c2ec.withdrawal WHERE confirmed_row_id < (SELECT MAX(confirmed_row_id) FROM c2ec.withdrawal) ORDER BY confirmed_row_id DESC LIMIT $2" // PS_CONFIRMED_TRANSACTIONS_DESC_MAX
+ query = "SELECT * FROM c2ec.withdrawal WHERE confirmed_row_id < (SELECT MAX(confirmed_row_id) FROM c2ec.withdrawal) ORDER BY confirmed_row_id DESC LIMIT $1" // PS_CONFIRMED_TRANSACTIONS_DESC_MAX
}
} else {
if start < 0 {
@@ -534,14 +534,11 @@ func (db *C2ECPostgres) GetConfirmedWithdrawals(start int, delta int, since time
var row pgx.Rows
var err error
- if start < 0 {
- // use latest id instead of a concrete id, because start
- // identifier was negative. Inidicates to read the most
- // recent ids.
+
+ if start < 0 && delta < 0 {
row, err = db.pool.Query(
db.ctx,
query,
- offset,
limit,
)
} else {