diff --git a/params/config.go b/params/config.go index 1597548cb..3d2266729 100644 --- a/params/config.go +++ b/params/config.go @@ -597,6 +597,9 @@ type ShhextConfig struct { // AnonMetricsServerPostgresURI is the uri used to connect to a postgres db AnonMetricsServerPostgresURI string + + // BandwidthStatsEnabled indicates if a signal is going to be emitted to indicate the upload and download rate + BandwidthStatsEnabled bool } // Validate validates the ShhextConfig struct and returns an error if inconsistent values are found diff --git a/services/ext/service.go b/services/ext/service.go index ff59a0fd8..db274d57e 100644 --- a/services/ext/service.go +++ b/services/ext/service.go @@ -164,7 +164,11 @@ func (s *Service) StartMessenger() (*protocol.MessengerResponse, error) { } go s.retrieveMessagesLoop(time.Second, s.cancelMessenger) go s.verifyTransactionLoop(30*time.Second, s.cancelMessenger) - go s.retrieveStats(5*time.Second, s.cancelMessenger) + + if s.config.BandwidthStatsEnabled { + go s.retrieveStats(5*time.Second, s.cancelMessenger) + } + return response, nil }