Skip to content

Commit

Permalink
chore: smooth diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed May 26, 2022
1 parent 226c7df commit adad86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dot/rpc/subscription/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ func (c *WSConn) readWebsocketMessage() (rawBytes []byte, wsMessage *websocketMe

// HandleConn handles messages received on websocket connections
func (c *WSConn) HandleConn() {
defer c.Wsconn.Close()

for {
rawBytes, wsMessage, err := c.readWebsocketMessage()
if err != nil {
Expand All @@ -83,12 +81,14 @@ func (c *WSConn) HandleConn() {
}

logger.Tracef("websocket message received: %s", string(rawBytes))

if wsMessage.Method == "" {
c.safeSendError(0, big.NewInt(InvalidRequestCode), InvalidRequestMessage)
continue
}

logger.Debugf("ws method %s called with params %v", wsMessage.Method, wsMessage.Params)

if !strings.Contains(wsMessage.Method, "_unsubscribe") && !strings.Contains(wsMessage.Method, "_unwatch") {
setupListener := c.getSetupListener(wsMessage.Method)

Expand Down

0 comments on commit adad86e

Please sign in to comment.