Skip to content

Commit 7843192

Browse files
authored
Merge pull request #16217 from karalabe/rpc-receipt-fetch-fix
internal/ethapi: fix getTransactionReceipt
2 parents 8f43c97 + ba7b384 commit 7843192

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/ethapi/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,14 +1035,14 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
10351035
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
10361036
tx, blockHash, blockNumber, index := core.GetTransaction(s.b.ChainDb(), hash)
10371037
if tx == nil {
1038-
return nil, errors.New("unknown transaction")
1038+
return nil, nil
10391039
}
10401040
receipts, err := s.b.GetReceipts(ctx, blockHash)
10411041
if err != nil {
10421042
return nil, err
10431043
}
10441044
if len(receipts) <= int(index) {
1045-
return nil, errors.New("unknown receipt")
1045+
return nil, nil
10461046
}
10471047
receipt := receipts[index]
10481048

0 commit comments

Comments
 (0)