The telemetry should not be initialized if no telemetry has been provided (#6666)

* Initial commit

Forked at: e10598af1f
Parent branch: origin/master

* Fix: do not initialize telemetry if telemetry is not set

* Update client/telemetry/src/lib.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update client/telemetry/src/lib.rs

* Update client/telemetry/src/lib.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
Cecile Tonglet
2020-07-16 11:46:40 +02:00
committed by GitHub
parent 2827637103
commit 4ac2078992
2 changed files with 14 additions and 2 deletions
+7
View File
@@ -123,6 +123,13 @@ impl TelemetryEndpoints {
}
}
impl TelemetryEndpoints {
/// Return `true` if there are no telemetry endpoints, `false` otherwise.
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
/// Parses a WebSocket URL into a libp2p `Multiaddr`.
fn url_to_multiaddr(url: &str) -> Result<Multiaddr, libp2p::multiaddr::Error> {
// First, assume that we have a `Multiaddr`.