Merge pull request #16217 from karalabe/rpc-receipt-fetch-fix

internal/ethapi: fix getTransactionReceipt
pull/16191/merge
Péter Szilágyi 7 years ago committed by GitHub
commit 7843192c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      internal/ethapi/api.go

@ -1035,14 +1035,14 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
tx, blockHash, blockNumber, index := core.GetTransaction(s.b.ChainDb(), hash)
if tx == nil {
return nil, errors.New("unknown transaction")
return nil, nil
}
receipts, err := s.b.GetReceipts(ctx, blockHash)
if err != nil {
return nil, err
}
if len(receipts) <= int(index) {
return nil, errors.New("unknown receipt")
return nil, nil
}
receipt := receipts[index]

Loading…
Cancel
Save