diff options
Diffstat (limited to 'rpc/http.go')
-rw-r--r-- | rpc/http.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rpc/http.go b/rpc/http.go index 971032d71..0fe634dee 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -28,7 +28,7 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler { // Limit request size to resist DoS if req.ContentLength > maxSizeReqLength { jsonerr := &RpcErrorObject{-32700, "Request too large"} - jsw.Send(w, &RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr}) + jsw.Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr}) return } @@ -36,7 +36,7 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler { body, err := ioutil.ReadAll(req.Body) if err != nil { jsonerr := &RpcErrorObject{-32700, "Could not read request body"} - jsw.Send(w, &RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr}) + jsw.Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr}) } // Try to parse the request as a single @@ -62,7 +62,7 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler { // Not a batch or single request, error jsonerr := &RpcErrorObject{-32600, "Could not decode request"} - jsw.Send(w, &RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr}) + jsw.Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr}) }) } @@ -71,16 +71,16 @@ func RpcResponse(api *EthereumApi, request *RpcRequest) *interface{} { reserr := api.GetRequestReply(request, &reply) switch reserr.(type) { case nil: - response = &RpcSuccessResponse{JsonRpc: jsonrpcver, ID: request.ID, Result: reply} + response = &RpcSuccessResponse{Jsonrpc: jsonrpcver, Id: request.Id, Result: reply} case *NotImplementedError: jsonerr := &RpcErrorObject{-32601, reserr.Error()} - response = &RpcErrorResponse{JsonRpc: jsonrpcver, ID: request.ID, Error: jsonerr} + response = &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: request.Id, Error: jsonerr} case *DecodeParamError, *InsufficientParamsError, *ValidationError: jsonerr := &RpcErrorObject{-32602, reserr.Error()} - response = &RpcErrorResponse{JsonRpc: jsonrpcver, ID: request.ID, Error: jsonerr} + response = &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: request.Id, Error: jsonerr} default: jsonerr := &RpcErrorObject{-32603, reserr.Error()} - response = &RpcErrorResponse{JsonRpc: jsonrpcver, ID: request.ID, Error: jsonerr} + response = &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: request.Id, Error: jsonerr} } rpchttplogger.DebugDetailf("Generated response: %T %s", response, response) |