Skip to content

Commit

Permalink
getTransactionByHash should return null if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy committed Oct 1, 2024
1 parent e04794d commit 83d8598
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/quaiapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,10 +1373,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, addr
// GetTransactionByHash returns the transaction for the given hash
func (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error) {
// Try to return an already finalized transaction
tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
if err != nil {
return nil, err
}
tx, blockHash, blockNumber, index, _ := s.b.GetTransaction(ctx, hash)
if tx != nil {
header, err := s.b.HeaderByHash(ctx, blockHash)
if err != nil {
Expand Down

0 comments on commit 83d8598

Please sign in to comment.