mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 18:00:46 +00:00
internal/ethapi: add comment explaining return of nil instead of error (#25097)
This commit is contained in:
parent
dc94ad52f6
commit
77e2ad90cf
1 changed files with 2 additions and 0 deletions
|
|
@ -2229,6 +2229,8 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
|
||||||
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
|
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
|
||||||
tx, blockHash, blockNumber, index := core.GetTransaction(s.b.ChainDb(), hash)
|
tx, blockHash, blockNumber, index := core.GetTransaction(s.b.ChainDb(), hash)
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
|
// When the transaction doesn't exist, the RPC method should return JSON null
|
||||||
|
// as per specification.
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
receipts, err := s.b.GetReceipts(ctx, blockHash)
|
receipts, err := s.b.GetReceipts(ctx, blockHash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue