mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 23:25:22 +00:00
rpc/server: be more specific in some sendrawtransaction error cases
Refs. #1894.
This commit is contained in:
parent
973ed8c1f6
commit
274f2c0408
1 changed files with 3 additions and 3 deletions
|
@ -1419,15 +1419,15 @@ func (s *Server) submitOracleResponse(ps request.Params) (interface{}, *response
|
|||
|
||||
func (s *Server) sendrawtransaction(reqParams request.Params) (interface{}, *response.Error) {
|
||||
if len(reqParams) < 1 {
|
||||
return nil, response.ErrInvalidParams
|
||||
return nil, response.NewInvalidParamsError("not enough parameters", nil)
|
||||
}
|
||||
byteTx, err := reqParams[0].GetBytesBase64()
|
||||
if err != nil {
|
||||
return nil, response.ErrInvalidParams
|
||||
return nil, response.NewInvalidParamsError("not base64", err)
|
||||
}
|
||||
tx, err := transaction.NewTransactionFromBytes(byteTx)
|
||||
if err != nil {
|
||||
return nil, response.ErrInvalidParams
|
||||
return nil, response.NewInvalidParamsError("can't decode transaction", err)
|
||||
}
|
||||
return getRelayResult(s.coreServer.RelayTxn(tx), tx.Hash())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue