code: func (*wsNotificationManager) notifyBlockConnected(clients map[chan struct{}]*wsClient,
  	block *btcutil.Block) {
  
  	// Notify interested websocket clients about the connected block.
  	ntfn := btcjson.NewBlockConnectedNtfn(block.Hash().String(), block.Height(),
  		block.MsgBlock().Header.Timestamp.Unix())
  	marshalledJSON, err := btcjson.MarshalCmd(nil, ntfn)
  	if err != nil {
  		rpcsLog.Errorf("Failed to marshal block connected notification: "+
  			"%v", err)
  		return
  	}
  	for _, wsc := range clients {
  		wsc.QueueNotification(marshalledJSON)
  	}
  }
docs: // notifyBlockConnected notifies websocket clients that have registered for
  // block updates when a block is connected to the main chain.