@@ -154,7 +154,7 @@ func handleBatchRequest(w http.ResponseWriter, body []byte, conns *p2p.Conns, ch
154154 continue
155155 }
156156
157- tx , response := validateTransaction (req , chainID )
157+ tx , response := validateTx (req , chainID )
158158 if tx == nil {
159159 responses = append (responses , response )
160160 continue
@@ -190,10 +190,10 @@ func handleBatchRequest(w http.ResponseWriter, body []byte, conns *p2p.Conns, ch
190190 }
191191}
192192
193- // validateTransaction validates a transaction from a JSON-RPC request by decoding the raw
193+ // validateTx validates a transaction from a JSON-RPC request by decoding the raw
194194// transaction hex, unmarshaling it, and verifying the signature. Returns the transaction if valid
195195// (with an empty response), or nil transaction with an error response if validation fails.
196- func validateTransaction (req rpcRequest , chainID * big.Int ) (* types.Transaction , rpcResponse ) {
196+ func validateTx (req rpcRequest , chainID * big.Int ) (* types.Transaction , rpcResponse ) {
197197 // Check params
198198 if len (req .Params ) == 0 {
199199 return nil , rpcResponse {
@@ -280,9 +280,9 @@ func validateTransaction(req rpcRequest, chainID *big.Int) (*types.Transaction,
280280// transaction, broadcasts it to all connected peers, and writes the transaction hash
281281// as a JSON-RPC response.
282282func handleSendRawTransaction (w http.ResponseWriter , req rpcRequest , conns * p2p.Conns , chainID * big.Int ) {
283- tx , errResp := validateTransaction (req , chainID )
283+ tx , response := validateTx (req , chainID )
284284 if tx == nil {
285- writeError (w , errResp .Error .Code , errResp .Error .Message , errResp .ID )
285+ writeError (w , response .Error .Code , response .Error .Message , response .ID )
286286 return
287287 }
288288
0 commit comments