Skip to content

Commit

Permalink
Actually filter for the tx hash you want 🤦
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Apr 16, 2024
1 parent 17206d1 commit adbfbcd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/soroban-rpc/internal/db/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,16 @@ func (txn *TransactionHandler) GetLedgerRange() ledgerbucketwindow.LedgerRange {
func (txn *TransactionHandler) GetTransactionByHash(hash string) (
xdr.LedgerCloseMeta, ingest.LedgerTransaction, error,
) {
rawHash, err := hex.DecodeString(hash)
if err != nil {
return xdr.LedgerCloseMeta{}, ingest.LedgerTransaction{}, err
}

rows := sq.
Select("t.application_order", "lcm.meta").
From(fmt.Sprintf("%s t", transactionTableName)).
Join(fmt.Sprintf("%s lcm ON (t.ledger_sequence = lcm.sequence)", ledgerCloseMetaTableName)).
Where(sq.Eq{"hash": rawHash}).
Limit(1).
RunWith(txn.stmtCache).
QueryRow()
Expand Down

0 comments on commit adbfbcd

Please sign in to comment.