mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-23 15:14:32 +00:00
Disable function send transaction with rpc
This commit is contained in:
parent
6d0d7c9313
commit
ed2859171a
1 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
@ -442,4 +452,4 @@ func (s *Server) readRequest(codec ServerCodec) ([]*serverRequest, bool, Error)
|
|||
}
|
||||
|
||||
return requests, batch, nil
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue