Skip to content

Commit 09e1bd5

Browse files
committed
fix: nits
1 parent 7f328d7 commit 09e1bd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/p2p/sensor/rpc.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
282282
func 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

Comments
 (0)