From 0f4d266b9bfcf05469d168779d0b395abbcfa85c 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index da7d36c24d..3423d18abd 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -531,7 +531,10 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address common.Addre // GetBlockReceipts returns the block receipts for the given block hash or number or tag. func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error) { block, err := api.b.BlockByNumberOrHash(ctx, blockNrOrHash) - if block == nil || err != nil { + 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