Prevent QUIC logs when quic is disabled (#5071)

* Prevent logs and dialing quic multiaddrs when not supported

* Merge latest unstable
This commit is contained in:
Age Manning
2024-01-31 18:11:49 +00:00
committed by GitHub
parent 7582da7855
commit f02189c86a
4 changed files with 18 additions and 4 deletions

View File

@@ -104,6 +104,8 @@ pub struct PeerManager<TSpec: EthSpec> {
discovery_enabled: bool,
/// Keeps track if the current instance is reporting metrics or not.
metrics_enabled: bool,
/// Keeps track of whether the QUIC protocol is enabled or not.
quic_enabled: bool,
/// The logger associated with the `PeerManager`.
log: slog::Logger,
}
@@ -149,6 +151,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
status_interval,
ping_interval_inbound,
ping_interval_outbound,
quic_enabled,
} = cfg;
// Set up the peer manager heartbeat interval
@@ -167,6 +170,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
heartbeat,
discovery_enabled,
metrics_enabled,
quic_enabled,
log: log.clone(),
})
}