From 6ca39a3d712e0057530fef7b5a306762d3b00fd9 Mon Sep 17 00:00:00 2001 From: James Smoot Date: Wed, 30 Mar 2022 18:44:30 -0700 Subject: [PATCH] Default to JSONRPC 1.0 if the rpcVersion empty --- btcjson/jsonrpc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/btcjson/jsonrpc.go b/btcjson/jsonrpc.go index 553a7bc37f..ea4a213bca 100644 --- a/btcjson/jsonrpc.go +++ b/btcjson/jsonrpc.go @@ -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)