diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index e8a201f71..900335988 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -307,10 +307,8 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { var r *types.Receipt err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash) - if err == nil { - if r == nil { - return nil, ethereum.NotFound - } + if err == nil && r == nil { + return nil, ethereum.NotFound } return r, err }