mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
rpcclient: Update for go1.10 breaking changes.
Go 1.10 made some changes such that json.Unmarshal can no longer unmarshal into exported fields that are themselves embedded via an uninitialized unexported pointer. Since rpcclient previously relied on this behavior, this updates the client to create the pointers before unmarshalling into the struct.
This commit is contained in:
parent
1cd648d784
commit
2be2f12b35
@ -310,6 +310,8 @@ func (c *Client) handleMessage(msg []byte) {
|
||||
// Attempt to unmarshal the message as either a notification or
|
||||
// response.
|
||||
var in inMessage
|
||||
in.rawResponse = new(rawResponse)
|
||||
in.rawNotification = new(rawNotification)
|
||||
err := json.Unmarshal(msg, &in)
|
||||
if err != nil {
|
||||
log.Warnf("Remote server sent invalid message: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user