From 4a7bf165c4a11e1a295ee0938ed390f086b79db7 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Fri, 6 Nov 2020 10:20:03 -0800 Subject: [PATCH] cleanup --- server/ws/websockets.go | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/server/ws/websockets.go b/server/ws/websockets.go index a32029a87..a0c665efe 100644 --- a/server/ws/websockets.go +++ b/server/ws/websockets.go @@ -180,32 +180,6 @@ func (ws *Server) BroadcastBlockDelete(blockID string, parentID string) { ws.BroadcastBlockChange(block) } -/* -func (ws *Server) BroadcastBlockDelete1(blockIDs []string) { - for _, blockID := range blockIDs { - listeners := ws.GetListeners(blockID) - log.Printf("%d listener(s) for blockID: %s", len(listeners), blockID) - - if listeners != nil { - message := DeleteMsg{ - Action: "DELETE_BLOCK", - BlockID: blockID, - } - - for _, listener := range listeners { - log.Printf("Broadcast change, blockID: %s, remoteAddr: %s", blockID, listener.RemoteAddr()) - - err := listener.WriteJSON(message) - if err != nil { - log.Printf("broadcast error: %v", err) - listener.Close() - } - } - } - } -} -*/ - // BroadcastBlockChange broadcasts update messages to clients func (ws *Server) BroadcastBlockChange(block model.Block) { blockIDsToNotify := []string{block.ID, block.ParentID}