Skip to content

Commit

Permalink
Merge pull request ethereum#155 from nguyenbatam/disable_func_send_tr…
Browse files Browse the repository at this point in the history
…ansaction_with_rpc

Disable function send transaction with rpc
  • Loading branch information
ngtuna authored Aug 29, 2018
2 parents 46e8e17 + 6d1ee2e commit 7c55084
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,18 @@ func (s *Server) serveRequest(codec ServerCodec, singleShot bool, options CodecO
// If a single shot request is executing, run and return immediately
if singleShot {
if batch {
for _, req := range reqs {
if req.callb != nil && req.callb.method.Name == "SendTransaction" {
codec.Write(codec.CreateErrorResponse(&req.id, &invalidRequestError{message: "Only support send transaction with ipc"}))
return nil
}
}
s.execBatch(ctx, codec, reqs)
} else {
if reqs[0].callb != nil && reqs[0].callb.method.Name == "SendTransaction" {
codec.Write(codec.CreateErrorResponse(&reqs[0].id, &invalidRequestError{message: "Only support send transaction with ipc"}))
return nil
}
s.exec(ctx, codec, reqs[0])
}
return nil
Expand Down

0 comments on commit 7c55084

Please sign in to comment.