From ffe56f54c459a7a6eb872225babb511d10ba1c6c Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 3 Nov 2025 15:20:04 +0800 Subject: [PATCH] internal/ethapi: fix missing proper error propagation, close XFN-118 (#1683) --- internal/ethapi/api.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 649b009b0a..9f2cf3a4ae 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -494,9 +494,12 @@ func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.A } // GetBlockReceipts returns the block receipts for the given block hash or number or tag. -func (s *PublicBlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error) { - block, err := s.b.BlockByNumberOrHash(ctx, blockNrOrHash) - if block == nil || err != nil { +func (api *PublicBlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error) { + block, err := api.b.BlockByNumberOrHash(ctx, blockNrOrHash) + if err != nil { + return nil, err + } + if block == nil { // When the block doesn't exist, the RPC method should return JSON null // as per specification. return nil, nil