Skip to content

Commit 6ef871c

Browse files
authored
add txn_participation.round filter (#1578)
1 parent 2517879 commit 6ef871c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

idb/postgres/postgres.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,16 @@ func buildTransactionQuery(tf idb.TransactionFilter) (query string, whereArgs []
510510
whereParts = append(whereParts, fmt.Sprintf("p.addr = $%d", partNumber))
511511
whereArgs = append(whereArgs, tf.Address)
512512
partNumber++
513+
if tf.MinRound != 0 {
514+
whereParts = append(whereParts, fmt.Sprintf("p.round >= $%d", partNumber))
515+
whereArgs = append(whereArgs, tf.MinRound)
516+
partNumber++
517+
}
518+
if tf.MaxRound != 0 {
519+
whereParts = append(whereParts, fmt.Sprintf("p.round <= $%d", partNumber))
520+
whereArgs = append(whereArgs, tf.MaxRound)
521+
partNumber++
522+
}
513523
if tf.AddressRole != 0 {
514524
addrBase64 := encoding.Base64(tf.Address)
515525
roleparts := make([]string, 0, 8)

0 commit comments

Comments
 (0)