diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 6960ec9..ec4ae68 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -35,8 +35,6 @@ type HTTPAgentConfig struct { Logger log.Logger // Address is used for the rpc.Listener function. Address string - // Interval is the interval at which to publish prices in seconds. - //Interval uint32 `hcl:"interval"` } // HTTPAgent returns the services that are configured from the Config struct. @@ -147,12 +145,7 @@ func (s *HTTPAgent) handlePrices(w http.ResponseWriter, r *http.Request) { _, _ = io.WriteString(w, `{"error":"failed to check prices"}`) return } - //b, err := json.Marshal(prices) - //if err != nil { - // s.log.Errorf("failed to marshal response: %v", err) - // _, _ = io.WriteString(w, `{"error":"failed to marshal json"}`) - // return - //} + for _, p := range prices { if mErr := s.marshaller.Write(w, p); mErr != nil { _ = s.marshaller.Write(w, mErr) diff --git a/pkg/prices/cache.go b/pkg/prices/cache.go index 68fb8b5..e593862 100644 --- a/pkg/prices/cache.go +++ b/pkg/prices/cache.go @@ -114,17 +114,6 @@ func (g *Cache) update(pair provider.Pair) error { price := &median.Price{Wat: pair.Base + pair.Quote, Age: tick.Time} price.SetFloat64Price(tick.Price) - // Broadcast price to P2P network. - //msg, err := toPriceMessage(price, tick) - //if err != nil { - // return err - //} - //if err := g.transport.Broadcast(messages.PriceV0MessageName, msg.AsV0()); err != nil { - // return err - //} - //if err := g.transport.Broadcast(messages.PriceV1MessageName, msg.AsV1()); err != nil { - // return err - //} return err }