From cc8ef611c59d39f49d6a4f1d6561abb09cb289b9 Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 23 Apr 2024 22:46:16 -0400 Subject: [PATCH] Updates/Adds TODOs --- zebra-network/src/config.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zebra-network/src/config.rs b/zebra-network/src/config.rs index 4bb266ef1..c2a1501a1 100644 --- a/zebra-network/src/config.rs +++ b/zebra-network/src/config.rs @@ -230,9 +230,7 @@ impl Config { Network::Testnet(params) if params.is_default_testnet() => { self.initial_testnet_peers.clone() } - // TODO: Check if the network is an incompatible custom testnet (_not_ Regtest), then panic if `initial_testnet_peers` - // contains any of the default testnet peers, or return `initial_testnet_peers` otherwise. See: - // + // TODO: Add a `disable_peers` field to `Network` to check instead of `is_default_testnet()` (#8361) Network::Testnet(_params) => IndexSet::new(), } } @@ -248,8 +246,13 @@ impl Config { let dns_peers = Config::resolve_peers(&self.initial_peer_hostnames().iter().cloned().collect()).await; - // Ignore disk errors because the cache is optional and the method already logs them. - let disk_peers = self.load_peer_cache().await.unwrap_or_default(); + // TODO: Add a `disable_peers` field to `Network` to check instead of `!is_regtest()` (#8361) + let disk_peers = if !self.network.is_regtest() { + // Ignore disk errors because the cache is optional and the method already logs them. + self.load_peer_cache().await.unwrap_or_default() + } else { + Default::default() + }; dns_peers.into_iter().chain(disk_peers).collect() }