mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
Default to JSONRPC 1.0 if the rpcVersion empty
This commit is contained in:
parent
074266215c
commit
71c844310a
@ -157,6 +157,9 @@ func (request *Request) UnmarshalJSON(b []byte) error {
|
||||
// request.
|
||||
func NewRequest(rpcVersion RPCVersion, id interface{}, method string, params []interface{}) (*Request, error) {
|
||||
// default to JSON-RPC 1.0 if RPC type is not specified
|
||||
if rpcVersion == "" {
|
||||
rpcVersion = RpcVersion1
|
||||
}
|
||||
if !rpcVersion.IsValid() {
|
||||
str := fmt.Sprintf("rpcversion '%s' is invalid", rpcVersion)
|
||||
return nil, makeError(ErrInvalidType, str)
|
||||
|
Loading…
Reference in New Issue
Block a user